Re: Transaction Isolation level

From: Martin Thelian (martin.thelia..ovo.cc)
Date: Thu Oct 04 2007 - 06:45:52 EDT

  • Next message: Emilian Bold: "Re: DataRowStore.sendUpdateNotification NullPointerException"

    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?

    Thanks,
    Martin



    This archive was generated by hypermail 2.0.0 : Thu Oct 04 2007 - 06:49:39 EDT