db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: How to set default isolation level
Date Fri, 17 Jul 2009 09:34:05 GMT
Damian Hofmann <damian.hofmann@gmx.ch> writes:

> Hi,
>
> I have a question about isolation levels. In the chapter "Configuring
> isolation levels" the Derby Developer's Guide mentions, that the
> default isolation level for new connections is CS
> (TRANSACTION_READ_COMMITTED). It also states, that if the isolation
> level is set to RR the connection inherits the isolation level
> TRANSACTION_SERIALIZABLE, which is the right one for me. But I can't
> figure out how I change the default isolation level.
>
> Is there a way to change the  default isolation level so every new
> connection will inherit TRANSACTION_SERIALIZABLE? Or do I have to set
> this isolation level for every transaction manually?

Hi Damian,

As far as I know, there isn't any way to change the default isolation
level for newly created Connection objects, so I'm afraid the easiest
way is to call Connection.setTransactionIsolation() on each
Connection. Note that you can use one Connection object for many
transactions, and you only need to set the isolation level once per
Connection, not once per transaction.

-- 
Knut Anders

Mime
View raw message