You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Malcolm Edgar <ma...@gmail.com> on 2016/04/13 14:28:23 UTC
Query Isolation - Dirty Reads
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: Query Isolation - Dirty Reads
Posted by Malcolm Edgar <ma...@gmail.com>.
Thank you much appreciated.
regards Malcolm
On Thu, Apr 14, 2016 at 4:42 PM, Andrus Adamchik <an...@objectstyle.org>
wrote:
> 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
> BaseTransaction.getThreadTransaction().addConnection(..) to customize the
> connection.
>
> Andrus
>
>
> [1]
> http://cayenne.apache.org/docs/4.0/cayenne-guide/persistent-objects-objectcontext.html#transactions
>
> > On Apr 13, 2016, at 3:28 PM, Malcolm Edgar <ma...@gmail.com>
> wrote:
> >
> > 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: Query Isolation - Dirty Reads
Posted by Andrus Adamchik <an...@objectstyle.org>.
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 BaseTransaction.getThreadTransaction().addConnection(..) to customize the connection.
Andrus
[1] http://cayenne.apache.org/docs/4.0/cayenne-guide/persistent-objects-objectcontext.html#transactions
> On Apr 13, 2016, at 3:28 PM, Malcolm Edgar <ma...@gmail.com> wrote:
>
> 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