ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hemant.Kamatgi" <Hemant.Kama...@target.com>
Subject RE: Global Transactions or Ibatis's Automatic transactions
Date Fri, 29 Jun 2007 14:07:46 GMT
Ashok,

I had mentioned the JNDI name of the directly in the  sqlmapconfig.xml
viz, jdbc/exampleDB (I mean not the reference like
java:comp/env/jdbc/exampleDB) and transactionmanager type was
'EXTERNAL'. Plus we were starting our transaction in our business layer
and not in the DAO layer. We have used both BMT(UserTransaction)and CMT
to start and end transactions and it has worked quite well.

Regards
Hemant

-----Original Message-----
From: ashok [mailto:ashok@sraindia.com] 
Sent: Friday, June 29, 2007 4:00 AM
To: user-java@ibatis.apache.org
Subject: Re: Global Transactions or Ibatis's Automatic transactions


I am trying to add Ibatis persistence to struts , cannot use springs.
When daoManager.startTransaction();  how can we ensure that the JTA's
transaction is being called and not the Ibatis Automatic transactions.


Meindert wrote:
> Ibatis DAO has been depreciated.. Use spring instead
>
> -----Original Message-----
> From: ashok [mailto:ashok@sraindia.com] 
> Sent: 29 June 2007 09:53 AM
> To: ibatis
> Subject: Global Transactions or Ibatis's Automatic transactions
>
> Hi
>
> Does the daoManger.startTransaction(); created refers to the Global 
> transactions or Ibatis  Automatic transactions?
> What changes to be made if I need to use global transactions?
>
> In my  DaoIntializer class  I create the daoManager as follows :
>
> Reader reader =
Resources.getResourceAsReader("com/example/config/dao.xml");
>             daoManager = DaoManagerBuilder.buildDaoManager(reader);
>
> and  dao.xml, sqlMapConfig.xml and web.xml contains the following
enteries:
>
> In my dao.xml :
> <daoConfig>
>     <context>
>         <transactionManager type="SQLMAP">
>             <property name="SqlMapConfigResource"
>                 value="com/example/config/sqlMapConfig.xml" />
>         </transactionManager>
>
>         <dao interface="com.example.ibatis.UserTableDao"
>             implementation="com.example.ibatis.UserTableDaoImpl" />
>     </context>
> </daoConfig>
>
> In my sqlMapConfig.xml
>
> <sqlMapConfig>
>
>     <settings cacheModelsEnabled="true" enhancementEnabled="true"
>         lazyLoadingEnabled="true" errorTracingEnabled="false" 
> maxRequests="32"
>         maxSessions="10" maxTransactions="5" 
> useStatementNamespaces="false" />
>
>     <transactionManager type="EXTERNAL">
>      <property name="UserTransaction" 
> value="java:comp/env/UserTransaction"/>
>       <property name="SetAutoCommitAllowed" value="false"/>
>         <dataSource type="JNDI">
>         <property name="DataSource"
value="java:comp/env/jdbc/exampleDB" />
>         </dataSource>
>  
>    <sqlMap resource="com/example/ibatis/sqlMap/UserTable.xml" />
> </sqlMapConfig>
>
>
>
> In my web.xml :
>
>     <resource-ref>
>         <description>Example DBConnection</description>
>         <res-ref-name>jdbc/exampleDB</res-ref-name>
>         <res-type>javax.sql.DataSource</res-type>
>         <res-auth>Container</res-auth>
>     </resource-ref>
>
>     <resource-ref>
>         <description>Example Transaction Manger</description>
>         <res-ref-name>UserTransaction</res-ref-name>
>         <res-type>javax.transaction.UserTransaction</res-type>
>         <res-auth>Container</res-auth>
>     </resource-ref>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Regards
> Ashok
>
>   

Mime
View raw message