Re: Query Isolation - Dirty Reads

2016-04-13 Thread Andrus Adamchik
Hi Malcolm, Yeah, going to the connection level is probably the way to solve this. You will need to wrap your commit / select code in a manual transaction, which is fairly easy in 4.0 [1] (hmm... there's a typo in the docs. No "perform" method is shown). Inside your code you can use BaseTransa

Re: Fetching a list of objects from a list of primary keys

2016-04-13 Thread Andrus Adamchik
Actually a simple IN qualifier should work. Andrus > On Apr 12, 2016, at 11:38 AM, Hugi Thordarson wrote: > > Hi all. > I have a list of primary keys [3,4,5,etc…] and I’d like to fetch all the > corresponding objects in one go. > Do I have to expose the primary key of my entity to do this or i

Query Isolation - Dirty Reads

2016-04-13 Thread Malcolm Edgar
Hi Guys, Any recommendations on the best way to perform dirty reads with Cayenne. Should we resolve the connection object and change transaction isolation level, perform the dirty query and then revert back to serializable ? regards Malcolm Edgar

Re: How to execute a stored procedure as part of a commitChanges?

2016-04-13 Thread dollj
Hi Juan You can use context.modifiedObjects() to get a list of objects that have changed and then process each one, something like: Map changeMap = new HashMap<>(); for ( CayenneDataObject dataObj : (List) context.modifiedObjects() ) { DataRow changes = context.currentSnapshot( dataObj