Re: Is statement.executeBacth() a transaction?
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Fri, 31 Oct 2008 13:28:29 -0700 (PDT)
Lew wrote:
Did you read my answer that you quoted?
George wrote:
Well, it seems that either I did not get your explanation or you did
not make it clear enough. I appreciate your time and effort in the
usenet, but it does not help by sentences as this.
Well, I'm sorry it doesn't help you, but repeating my answer as a
question leaves me with the conclusion that you didn't read the
answer.
Lew:
If you set auto-commit to 'false', nothing happens automatically.
That is the whole point of setting auto-commit to 'false'.
George:
In my example above, I did set autocommit to false and use the
Then you must EXPLICITLY (to quote your shouting) call either
'commit()' or 'rollback()' to end the transaction.
commit() explicitly. The question is that, in case first update runs
fine and SQLException is thrown for the second "update", will the jdbc
automatically rollback to the situation before the transaction,
Question answered upthread.
(meaning rollback/wipe-out the first update), or should I do it
manually in the catch by calling rollback()? I do not think either
your post or the article gives a clear answer for this or maybe I just
missed the point somewhere.
I said:
You have to explicitly call either 'commit()' or 'rollback()' to
terminate the transaction.
You asked:
do I still need to EXPLICITLY have rollback() in the catch{} ...?
You repeated the answer almost word for word only with a question
mark.
You have to explicitly call either 'commit()' or 'rollback()' to end
the transaction.
I do not know how to make that clearer. I do not comprehend repeating
the answer with a question mark as a legitimate question. If you turn
off auto-commit, then you have to use either 'commit()' or
'rollback()' explicitly. It doesn't necessarily have to be in the
'catch' block, but it has to happen somewhere.
--
Lew
.
- References:
- Is statement.executeBacth() a transaction?
- From: George
- Re: Is statement.executeBacth() a transaction?
- From: Lew
- Re: Is statement.executeBacth() a transaction?
- From: George
- Re: Is statement.executeBacth() a transaction?
- From: Lew
- Re: Is statement.executeBacth() a transaction?
- From: George
- Re: Is statement.executeBacth() a transaction?
- From: Lew
- Re: Is statement.executeBacth() a transaction?
- From: George
- Re: Is statement.executeBacth() a transaction?
- From: Lew
- Re: Is statement.executeBacth() a transaction?
- From: George
- Re: Is statement.executeBacth() a transaction?
- From: Lew
- Re: Is statement.executeBacth() a transaction?
- From: George
- Is statement.executeBacth() a transaction?
- Prev by Date: Re: Date Time additions/parsing
- Next by Date: Re: Date Time additions/parsing
- Previous by thread: Re: Is statement.executeBacth() a transaction?
- Next by thread: Re: Is statement.executeBacth() a transaction?
- Index(es):
Relevant Pages
|