ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Bengl <mar...@dailyspring.net>
Subject Re: Transaction issue with 2.2.0
Date Tue, 27 Feb 2007 19:22:03 GMT
yes, thats correct - you should use the spring transactional support. If 
you are using only one database resource (only one oracle database for 
example) you needn't XA. you can use local jdbc transaction with spring.

see 
http://static.springframework.org/spring/docs/2.0.x/reference/transaction.html 
for more details

greetings
martin

Armeanu, Christian wrotes:
>
> I don't know about the transaction support with iBATIS DAO, but if you 
> could the recommended Spring DAO for example.  All you would need to 
> do is to configure the appropriate transaction manager. 
>
>  
>
> Chris
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* Dave Rodenbaugh [mailto:drodenbaugh@WILDBLUECORP.COM]
> *Sent:* Tuesday, February 27, 2007 10:52 AM
> *To:* user-java@ibatis.apache.org
> *Subject:* RE: Transaction issue with 2.2.0
>
>  
>
> If this is the answer, how does iBATIS support XA transactions?  Do I 
> need to use a different Oracle library, or configure this 
> differently?  I'm not an XA expert...
>
>  
>
> Thanks,
>
> -D
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* Armeanu, Christian [mailto:ArmeanuC@hsd.k12.or.us]
> *Sent:* Tuesday, February 27, 2007 10:12 AM
> *To:* user-java@ibatis.apache.org
> *Subject:* RE: Transaction issue with 2.2.0
>
> For all I know you need XA transactions for this to work...
>
>  
>
> Chris
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* Dave Rodenbaugh [mailto:drodenbaugh@WILDBLUECORP.COM]
> *Sent:* Tuesday, February 27, 2007 9:07 AM
> *To:* user-java@ibatis.apache.org
> *Subject:* RE: Transaction issue with 2.2.0
>
>  
>
> Oh...one other piece of possibly relevant info:
>
>  
>
> FooDao and BarDao are created in two separate JARs, each having their 
> own configuration properties (they point to the same DB, but different 
> schemas.  They share the same runtime user information).
>
>  
>
> Thanks,
>
> -D
>
> ------------------------------------------------------------------------
>
> *From:* Dave Rodenbaugh
> *Sent:* Tuesday, February 27, 2007 10:05 AM
> *To:* 'user-java@ibatis.apache.org'
> *Subject:* Transaction issue with 2.2.0
>
> Hello,
>
>  
>
> I have a question about a transaction scenario I'm doing...I see 
> problems when trying to use 
> startTransaction()/commitTransaction()/endTransaction with JDBC data 
> source.  I'm using Oracle 9.2 client libraries, and this is with 
> iBATIS-2.2.0.
>
>  
>
> Here's my code pattern--I have two Daos involved--one "Foo" and one 
> "Bar".  I'm transacting Foo here.  (I've tried transacting both and 
> get the same result, too--so it seems to be relating to the FooDao 
> transaction somehow)
>
>  
>
> DaoManager dm = FooDaoManager.getDaoManager();
>
> try
>
> {
>
>     dm.startTransaction();
>
>     op1UsingFooDao();
>
>     logger.info("1");
>
>     op2UsingFooDao();
>
>     logger.info("2");
>
>     op3UsingBarDao();                  //throws SQLException when the 
> Tx code is off, hangs here when using Tx
>
>     logger.info("3");    //never gets here...
>
>     dm.commitTransaction();
>
> }
>
> finally
>
> {
>
>     logger.info("Inside finally block");
>
>     dm.endTransaction();
>
> }
>
>  
>
> _Output with no transaction code (application terminates):_
>
> 1
>
> 2
>
> Inside finally block
>
>  
>
> _Output with transaction code present (application hangs):_
>
> 1
>
> 2
>
>  
>
> I expected that the transaction would roll back when an exception was 
> encountered by triggering the finally code.  However, since it hangs, 
> I don't know where or why it hung in op3UsingBarDao()...?
>
>  
>
> What am I doing wrong in this scenario and how should I correctly 
> address this?  This scenario is consistent with the documentation, but 
> the docs don't cover multiple DaoManager transactions...
>
>  
>
> Thanks,
>
> -Dave
>


Mime
View raw message