ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: iBATIS transactional behaviour
Date Tue, 08 Nov 2005 14:43:25 GMT
Answers to your questions:
 1. Yes

2. Depends on the database, and the isolation level of the transactions, and
the rows involved. If you want to pursue this further, then you could do
some reading on transaction isolation levels and dirty, repeatable, and
phantom reads. I've found the chapter on transactions in the Monson-Haefel
EJB book pretty helpful on this subject.
 3. No - this is two seperate transactions (not nested). Nested transactions
look like seperate, and nested, commit points within one "master"
transaction (in the same thread) - iBATIS does not support this.
 Jeff Butler
 On 11/8/05, Konda, Sreenivasulu (Consultant) <
Sreenivasulu.Konda@consultmail.net> wrote:
> Hi All,
>  I would like to know expected behaviour of iBATIS JDBC transactions.
> Please see below code snippets and details for the same.
>  daoManager.startTransaction();
>  insert("insertToTable1", Object1);
>  insert("insertToTable2", Object2);
>  update("updateTable3", Object3);
>  delete("deleteFromTable1", Object1);
> daoManager.commitTransaction();
>  Given above sequence of calls, assume that Thread1 is at
> update("updateTable3", Object3) call and Thread2 too entered into the same
> method where above exists.
>  Now
>  1) Will Thread2 be able to start another transaction before the tx1 got
> committed to DB, which was started by Thread1?
> 2) If Thread2 starts tx2, what would be the behaviour at DB level in this
> scenario?
> 3) If tx1 and tx2 are allowed simultaneously, is this called as nested
> transaction?
>  BTW, transaction manager type is JDB as you see below XML tags from
> sqlmap_config.xml.
>  <transactionManager type="JDBC">
> <dataSource type="JNDI">
> <property name="DataSource" value="java:comp/env/jdbc/abcDB"/>
> </dataSource>
> </transactionManager>
>  Please let me know your comments.
>  Thanks and regards,
> Sreenivas

View raw message