ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cowwoc <cow...@bbs.darktech.org>
Subject SqlSession.close() without committing
Date Mon, 05 Apr 2010 16:38:26 GMT
Hi,

     What happens if I close() a SqlSession without committing? Does 
iBatis guarantee that the transaction will roll back? I ask because I 
want to use the following pattern:

SqlSession session = factory.openSession();
try
{
   // do work
   session.commit();
}
finally
{
   session.close();
}

     If no exception is thrown, the session gets committed. Otherwise, 
it is rolled back without having to catch exceptions and explicitly roll 
back.

Thanks,
Gili

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message