[ANN] Apache Cayenne 4.0 Beta released

2017-06-12 Thread Andrus Adamchik
Very happy to announce Cayenne 4.0 Beta! After "just" 5 years we felt we had enough new features and need to wrap up and stabilize :) Seriously though, 4.0 is awesome and if you haven't had a chance to upgrade yet, now is the time! The API is frozen. There's nothing for you to lose by upgrading,

Re: Bootique, Cayenne and production

2017-06-12 Thread Pascal Robert
Ok, it is working if I remove the Cayenne tree in config.yml, while keeping the JDBC part, or else I get: Caused by: java.lang.IllegalStateException: No DataSources are available for Cayenne. Add a DataSource via 'bootique-jdbc' or map it in Cayenne project. > Le 12 juin 2017 à 09:32, Nikita Ti

Re: Bootique, Cayenne and production

2017-06-12 Thread Andrus Adamchik
> I was hoping to have a solution that would work on both Bootique and > non-Bootique apps :-) In which case you need the least common denominator for DS configuration, which is Cayenne. So do the opposite of what was initially suggested - keep the DataNode in Cayenne project and remove if from

Re: Bootique, Cayenne and production

2017-06-12 Thread Pascal Robert
> Le 12 juin 2017 à 11:36, Andrus Adamchik a écrit : > > Hi Pascal, > > Your example is a Bootique app. So it will have its connection info in > config.yml, and you don't need the properties. If you use your model in > another app that is not a Bootuque app, then the -D properties will work.

Re: Bootique, Cayenne and production

2017-06-12 Thread Andrus Adamchik
Hi Pascal, Your example is a Bootique app. So it will have its connection info in config.yml, and you don't need the properties. If you use your model in another app that is not a Bootuque app, then the -D properties will work. Or did I misunderstand your use case? Andrus > On Jun 12, 2017,

Re: Bootique, Cayenne and production

2017-06-12 Thread Amedeo Mantica
With Cayenne 3.x I had similar issue I had to delete the connection info nodes from the model, editing XML directly, dropping the entire then... @Override public void configure(Binder binder) { binder.bind(ResourceLocator.class).toInstance(new ClassLoaderResourceLocator()); //those g

Re: Bootique, Cayenne and production

2017-06-12 Thread John Huss
Cayenne is not going to read your System properties directly. If you set it in System properties to still have to pass it explicitly to the Cayenne module like Nikita's code sample does. On Mon, Jun 12, 2017 at 9:32 AM Pascal Robert wrote: > Tried that, no luck (at least with the Bootique app):

Re: Bootique, Cayenne and production

2017-06-12 Thread Nikita Timofeev
Well, it seems like you can't use this Cayenne feature as Bootique overwrites it with it's custom logic for resolving DataSource properly. So the only option I can see for you in this case is to delete connection information from the model and use Bootique config from Bootique app and cayenne.jdbc.

Re: Bootique, Cayenne and production

2017-06-12 Thread Pascal Robert
Tried that, no luck (at least with the Bootique app): java -Dcayenne.jdbc.url="jdbc:mysql://xx.xx.xx.xx:3306/filemaker?connectTimeout=0&autoReconnect=true" -jar RevendeursWeb-1.0.jar --config=config.yml —server Still connect to the URL defined in the model. > Le 12 juin 2017 à 09:32, Nikita Ti

Re: Bootique, Cayenne and production

2017-06-12 Thread Nikita Timofeev
Hi Pascal, Yes you can setup DataSource via PropertyDataSourceFactory[1] that can read all information from runtime properties. All you need is to provide those properties via env variables or directly in your code like this (this code for the latest 4.0 version): ServerRuntime cayenneRuntime = S

Re: Bootique, Cayenne and production

2017-06-12 Thread Pascal Robert
> Le 9 juin 2017 à 11:37, Andrus Adamchik a écrit : > > The easiest thing is to remove the DataNode from CayenneModel completely, and > use Bootique connections locally, in production and in other environments. And can I set the connection information in another way for non-Bootique apps? >