Subject | Re: [Firebird-Java] Transactions issues |
---|---|
Author | David Jencks |
Post date | 2002-12-06T17:11:58Z |
On 2002.12.06 08:35:59 -0500 Robert J. Munro wrote:
level.
The problem IMO is basically because the jdbc transaction model sucks. Lets
discuss a non-managed scenario here (outside an app server with jca
support). Any reasonable app will have autocommit off. Therefore there is
always a transaction active. A more plausible transaction model is the
javax.resource.cci.LocalTransaction which has begin and commit/rollback
methods. In between a commit/rollback and a begin, any statement is
autocommitted. In such a model, you'd just throw an exception if you tried
to change isolation level inside a transaction. BTW jaybird does provide
these LocalTransactions if you wish to use them.
Changing the isolation level is not likely to be something you do often,
and it's certainly recognizable in the code, so there should be no problem
assuring yourself that your app isn't in the middle of a logical unit of
work.
thanks
david jencks
> At 22:59 05/12/2002 -0000, you wrote:AFAIK most other java drivers commit immediately when you change isolation
> >Hi,
> >
> >I have changed transaction behavior on my computer and I'm ready to
> >commit. All test cases succeeded (except TestFBDriver.testWarnings(),
> >I will check if this is a Linux/CS specific issue). My changes were:
> >
> >a) no transaction is started right after commit/rollback;
> >b) setTransactionIsolation() calls commit and then modifies TPB;
> >c) TRANSACTION_NONE and TRANSACTION_READ_UNCOMMITTED are not supported
> >and are promoted to TRANSACTION_READ_COMMITTED.
>
> I'm really new to this stuff - I'm just learning Java, and this is my
> first
> post to the list, but I think that b is a *really* bad idea. In my
> application, if you commit a transaction at the wrong time, a lot of
> things
> get totally screwed up. I think that if there is a transaction in
> progress
> when you try to set an isolation level, it should probably throw an
> exception. You should't attempt this. I think I'd rather it rolled back
> than committed. If the spec says "you can wait until the next transaction
> before making the isolation level change", which you implied in an
> earlier
> post, then I'd definately do that.
level.
The problem IMO is basically because the jdbc transaction model sucks. Lets
discuss a non-managed scenario here (outside an app server with jca
support). Any reasonable app will have autocommit off. Therefore there is
always a transaction active. A more plausible transaction model is the
javax.resource.cci.LocalTransaction which has begin and commit/rollback
methods. In between a commit/rollback and a begin, any statement is
autocommitted. In such a model, you'd just throw an exception if you tried
to change isolation level inside a transaction. BTW jaybird does provide
these LocalTransactions if you wish to use them.
Changing the isolation level is not likely to be something you do often,
and it's certainly recognizable in the code, so there should be no problem
assuring yourself that your app isn't in the middle of a logical unit of
work.
thanks
david jencks
>
> Robert Munro
> --
> Robert (Jamie) Munro - IT department
> Viva Network - Helping 'children at risk'
> by linking & enhancing the Christian Response
> http://www.viva.org/
> PO Box 633, Oxford, England, OX2 0XZ
> Tel : +44 1865 320131 Switchboard : +44 1865 320 100
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>