Re: Controlling Cayennes JDBC connection usage

2017-10-12 Thread Andrus Adamchik
> but it seems to do that on every call to ObjectContext.commit()! We can clean up this code a bit to make sure custom strategies are not themselves responsible for synchronization of the call and ensuring a single invocation. Though if you extend from BaseSchemaUpdateStrategy or use one of t

Re: Cayenne runtime error with DI

2017-10-12 Thread Andrus Adamchik
FWIW, maven-shade-plugin configuration that properly merges META-INF/services contents and thus preserves module auto-loading may look like the following (taken from Bootique.io) : . ... org.apache.maven.plugins maven-shade-plugin true

Re: Cayenne-Tapestry integration problem

2017-10-12 Thread Juan Manuel Diaz Lara
Yes!!! I will try whitout it and report result.  Thanks. Atte. Juan Manuel Díaz Lara On Thursday, October 12, 2017, 1:14:30 PM CDT, Juan Manuel Diaz Lara wrote: I devoloped a module to integrate cayenne into apache-tapestry, using cayenne 4.0.M5 and tapestry 5.4.3... I the module I

Re: Controlling Cayennes JDBC connection usage

2017-10-12 Thread Dirk Lattermann
I experimented a bit with the SchemaUpdateStrategyFactory to create a test SchemaUpdateStrategy. It is correct that Cayenne calls the strategy before any app code can access the DB, but it seems to do that on every call to ObjectContext.commit()! That's quite surprising to me because I think it wou

Re: Cayenne-Tapestry integration problem

2017-10-12 Thread Michael Gentry
Hi Juan, In your Data Domain configuration (highest level item) in Cayenne Modeler, do you have Use Shared Cache checked? On Thu, Oct 12, 2017 at 2:14 PM, Juan Manuel Diaz Lara < jmdia...@yahoo.com.invalid> wrote: > I devoloped a module to integrate cayenne into apache-tapestry, using > cayenne

Cayenne-Tapestry integration problem

2017-10-12 Thread Juan Manuel Diaz Lara
I devoloped a module to integrate cayenne into apache-tapestry, using cayenne 4.0.M5 and tapestry 5.4.3... I the module I create a single ServerRuntime for mi web app, then, on each request I call serverRuntime.newContext(); to get a new fresh ObjectContext, but some way I get the same results i

Re: Cayenne runtime error with DI

2017-10-12 Thread Nikita Timofeev
You are welcome! It is not a dependency problem it's a Cayenne module loading problem. Java8 module wasn't enabled, thus causing your troubles. If meta information is there (file in META-INF/services/) Cayenne will load module without any help, but as it's not you should do this explicitly. On Th

Re: Cayenne runtime error with DI

2017-10-12 Thread Andrew Willerding
Thank you so much Nikita!  That did the trick!  I would never have been able to figure this out on my own. I'm new to Maven as a build tool and I've never heard of the shade plugin.  When I was trying to figure out how to build a JAR file with all dependencies I found this method via a Google

Re: Cayenne runtime error with DI

2017-10-12 Thread Nikita Timofeev
How do assemble your JAR file? Are you using maven-shade-plugin or something like that? That may be a problem as it will strip out meta information used by Cayenne's auto-loading mechanics. Can you try to include Java8Module directly, like this: ServerRuntime.builder().addModule(new Java8Module())

Re: Cayenne runtime error with DI

2017-10-12 Thread Andrew Willerding
And if I look in the packaged JAR file I can see the cayenne java8 classes so I don't understand why there is an issue with it missing?  Is there something else to check or a dependency I'm missing that is needed by Cayenne to utilize the java8 classes? On 12/10/17 10:58 AM, Nikita Timofeev wr

Re: Cayenne runtime error with DI

2017-10-12 Thread Nikita Timofeev
Well, this definitely looks like cayenne-java8 module missing. Cayenne tries to store your LocalDateTime as byte[]. On Thu, Oct 12, 2017 at 4:39 PM, Andrew Willerding wrote: > Hi Nikita, > > Your hunch is correct and I'm even more confused. I deleted all the records > in the database and re-ran m

Re: Cayenne runtime error with DI

2017-10-12 Thread Andrew Willerding
Hi Nikita, Your hunch is correct and I'm even more confused. I deleted all the records in the database and re-ran my application.  It's complaining of a cast to Date but I don't have any Date fields or objects.  Now I'm getting the following exception: org.apache.cayenne.CayenneRuntimeExcept

Re: Cayenne runtime error with DI

2017-10-12 Thread Nikita Timofeev
Hi Andrew, Your last exception seems like a Cayenne fallback to a serializable type when it doesn't now how to handle given value, are there any warnings preceding this exception? Something like "Haven't found suitable ExtendedType for class..."? On Wed, Oct 11, 2017 at 9:59 PM, Andrew Willerding