ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Qian" <daqiqi...@aol.com>
Subject Re: Rollback Issues
Date Thu, 15 Jun 2006 15:15:34 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
<font face="Arial,sans-serif"><font size="2">Yes. It worked for me
(MySQL).<br>
<br>
Tony<br>
<br>
<span type="cite">Debasish Dutta Roy wrote on 6/15/2006, 11:09 AM:</span>
</font></font>
<p><font face="Arial,sans-serif" size="2"></font></p>
<blockquote type="cite"  style="border-left: thin solid blue; padding-left: 10px; margin-left:
0pt;"><font  face="Arial,sans-serif" size="2">Hi All<br>
Has anyone successfully tested rollback with DAOManager implementation.<br>
  <br>
I am unable to get it working.<br>
  <br>
  <br>
I have a business delegate who does like this:<br>
  <br>
DAO1 dao1 = daoManager.getDAO(DAO1.class);<br>
DAO2 dao2 = daoManager.getDAO(DAO2.class);<br>
try {
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; daoManager.startTransaction();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dao1.firstTask();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dao2.secondTask();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; daoManager.commitTransaction();<br>
} catch (Exception e) {<br>
&nbsp;&nbsp; throw myException;<br>
} finally {<br>
&nbsp;&nbsp; daoManager.endTransaction
();<br>
}<br>
  <br>
  <br>
my dao.xml is like this<br>
  <br>
&nbsp;&nbsp;&nbsp; &lt;context&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;transactionManager type="SQLMAP"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;property name="SqlMapConfigResource"
value="xml/sql-map-config.xml
"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/transactionManager&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; ...........<br>
&nbsp;&nbsp;&nbsp;&nbsp; ...........<br>
&nbsp;&nbsp; &lt;/context&gt;<br>
  <br>
and the corresponding sql-map-config.xml<br>
  <br>
&lt;sqlMapConfig&gt;<br>
  <br>
&nbsp;&nbsp;&nbsp; &lt;transactionManager type="JDBC" commitRequired="true"&gt;
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;dataSource type="JNDI"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;property name="DataSource" value="<a class="moz-txt-link-freetext" href="java:comp/env/jdbc">java:comp/env/jdbc</a></font>
  <div><font face="Arial,sans-serif" size="2">/MyDataSource"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/dataSource&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/transactionManager&gt;
  <br>
  </font></div>
  <font face="Arial,sans-serif" size="2"></font></blockquote>
</body>
</html>


Mime
View raw message