cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Thelian <>
Subject Re: Transaction Isolation level
Date Thu, 04 Oct 2007 10:45:52 GMT
Andrus Adamchik schrieb:
>>>> and is there a way to change it to use serializable transactions?
>>> There's no direct API (maybe we should add it to Cayenne Transaction
>>> in 3.0?), but you can enable serializable transactions by wrapping
>>> your code in a Cayenne transaction manually [1] (see "User-Defined
>>> Transaction Scope" down the bottom), and setting Connection properties
>>> by hand.
>> Thank you for this tip.
>> It seems to work fine, except that the connection with the changed
>> isolation level is returned to pool [...] and therefore the next
>> thread (thread2) gets this connection
>> from pool, but with the changed transation-isolation-level.
> Or you can reset the state in the "finally" block of the manual
> transaction.
Yes, but this would not help to avoid a possible race-condition between
thread1 and another thread2. Because there is no guarantee that thread2
has not already send an SQL statement via the connection when thread1 is
reseting the transaction isolation level.

What about exclusive table locks? Any chance to use them with cayenne?


View raw message