Re: Behavior of Connection.commit()
Jerry Brenner wrote:
I'm confused by:
What this means is that the following scenario would behave
//start transaction
//insert data 1
//execute something that throws lev 16 server exception and ignore
exception. At this time insert data 1 has been rolled back!
//insert data 2
//COMMIT
If the exception from the 1st insert was a statement level exception (like
duplicate key violation), then it is up to the caller to decide what to do.
If the caller wants to continue, or even just call commit(), then they should
be allowed to do so. However, if the exception was a transaction level
exception or more severe, then a rollback should occur. Either way,
autocommit should remain off on the connection, so the caller should be able
to call commit() immediately.
Right. We can cobble up an exampel with two connections and provoke a
simple deadlock between them. One of them will get it's tx aborted,
and we should then see whether an immediate commit() and/or rollback()
gives a problem. Yes, the driver and DBMS should both still be in
chained/implicit transaction/autoCommit(false) mode.
Joe
.
Relevant Pages
- Re: HELP ME
... We need to insert/update data from temp table to staging tables. ... any User Define Exception to be handled and then use Raise Exception ... Above code template does not specify Commit statement. ... (comp.databases.oracle.misc) - HELP ME
... We need to insert/update data from temp table to staging tables. ... any User Define Exception to be handled and then use Raise Exception ... Above code template does not specify Commit statement. ... (comp.databases.oracle.misc) - Re: HELP ME
... We need to insert/update data from temp table to staging tables. ... any User Define Exception to be handled and then use Raise Exception ... Above code template does not specify Commit statement. ... (comp.databases.oracle.misc) - Re: HELP ME
... We need to execute update first and if SQL%ROWCOUNT < 1 then need to ... any User Define Exception to be handled and then use Raise Exception ... Above code template does not specify Commit statement. ... Name, Table primary key etc. ... (comp.databases.oracle.misc) - Re: Behavior of Connection.commit()
... >>> If the exception from the 1st insert was a statement level exception ... If the caller wants to continue, ... >>> commit(), then they should be allowed to do so. ... >>> connection, so the caller should be able to call commitimmediately. ... (microsoft.public.sqlserver.jdbcdriver) |
|