Re: Object relationship freshness

2016-04-19 Thread Andrus Adamchik
> *changing this to “false” While this may solve the immediate problem, turning off shared object cache is not terribly efficient. I would recommend against it. >>> weirdly I see one of the >>> relationship queries fire again, but not the other…either way both objects >>> “snapshots” (EOF term)

Re: StoredProcedures and Cayenne

2016-04-19 Thread Fredrik Widengren
Hello Andrus, Thanks for trying to help out. I'm using MariaDB (10.1.12-MariaDB-1~trusty), (org.mariadb.jdbc.Driver, JAR file mariadb-java-client-1.2.0.jar). I can check Cayenne version 4.0.M3 also. /Fredrik Here's the stored procedure I try to call. CREATE DEFINER=`foodbase_admin`@`localhost`

Re: Object relationship freshness

2016-04-19 Thread Lon Varscsak
*changing this to “false” On Tue, Apr 19, 2016 at 4:07 PM, Lon Varscsak wrote: > It looks like I had cayenne.DataDomain.sharedCache=true in my model. > Changing this to default solved my issue. Seem reasonable? > > On Tue, Apr 19, 2016 at 3:50 PM, Lon Varscsak > wrote: > >> Hey guys, >> >> I’m

Re: Object relationship freshness

2016-04-19 Thread Lon Varscsak
It looks like I had cayenne.DataDomain.sharedCache=true in my model. Changing this to default solved my issue. Seem reasonable? On Tue, Apr 19, 2016 at 3:50 PM, Lon Varscsak wrote: > Hey guys, > > I’m executing a query and then referencing the fetched object and some > relationships on the fetc

Object relationship freshness

2016-04-19 Thread Lon Varscsak
Hey guys, I’m executing a query and then referencing the fetched object and some relationships on the fetched object. Later, I create a new ObjectContext (old one is thrown away) and I issue the fetch again and I notice that the relationship objects are not refreshed (weirdly I see one of the rel

Re: ROP - Define order of inserts on large commit to multiple tables with relationships?

2016-04-19 Thread Adam Boyle
Hi Michael, Although my setup is not exactly the same, there are definite similarities, namely in the method to fetch a current revision. I may end up reverting the changes to add the circular FK relationships... it's probably not much different performance-wise to the server if I have to fetch

Re: ROP - Define order of inserts on large commit to multiple tables with relationships?

2016-04-19 Thread Michael Gentry
Hi Adam, To follow-up on Andrus' comment, have you considered recursive relationships? To do so, your TestScript would have getParent() and getPrevious() type methods/relationships which return a TestScript (if it exists) plus a parentFK attribute. I've used the following pattern in the past: T

Re: ROP - Define order of inserts on large commit to multiple tables with relationships?

2016-04-19 Thread Adam Boyle
I'm super-relieved that this facility exists! Thanks for your attention and fast reply! -Adam From: Andrus Adamchik Sent: Tuesday, April 19, 2016 3:31 AM To: user@cayenne.apache.org Subject: Re: ROP - Define order of inserts on large commit to multiple t

Re: ROP - Define order of inserts on large commit to multiple tables with relationships?

2016-04-19 Thread Andrus Adamchik
> Is it possible that the new "circular" FK relationships are confusing Cayenne > into inserting records into the tables in the wrong order? Yes, it would. Without circular relationships Cayenne provides reliable operation ordering. With those, the ordering gets messed up. > If so, is there a

Re: perform action server-side before commit/fetch

2016-04-19 Thread Andrus Adamchik
> I would like to have the hashing and validation code on the server to take > that power away from the client. Good idea. > Is it as simple as setting a pre-persist and post-load hook and only > implementing them on the server? Yep, callbacks are the way to solve this. Andrus > On Apr 16,

Re: StoredProcedures and Cayenne

2016-04-19 Thread Andrus Adamchik
Hi Fredrik, Sorry for late reply. So from the stack trace this is Cayenne 3.1: https://github.com/apache/cayenne/blob/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java#L101 Interesting ... So Cayenne thinks there's a ResultSet, w