You have configured iBATIS to NOT use the application server's connection pool - you've asked iBATIS to use it's own connection pool (DBCP).
 
If you mean that you want to call setRollBackOnly() in an EJB method, then this will not work with your current configuration.  If you want to use EJB's container managed transactions, you'll need to do the data source lookup from JNDI and configure iBATIS like this:
 
  <transactionManager type="EXTERNAL">
    <property name="SetAutoCommitAllowed" value="false"/>
   
    <dataSource type="JNDI">
      <property name="DataSource" value="java:comp/env/jdbc/hsdb"/>
    </dataSource>
  </transactionManager>

However, I remember from your previous posts that you need to use local credentials to create the database connection.  If that requirement remains, then you'll have to keep it the way it is and manage transactions with iBATIS code - rather than letting the container do it for you.
 
For this, and many other, reasons it would be best if you did not have to use local credentials to connect to your database.  It would be much better to pass the USER as a parameter to the procedures, rather than relying on the logon credential of the connection.
 
Jeff Butler
 
 
On 9/30/05, Vijai Senthil Padmanabhan Kalaiyarasi <[EMAIL PROTECTED]> wrote:
Hi,
 
    I have a doubt whether the iBATIS will use the connection pool of the Application server's or its own mechanism.
    Because I need to so a sesionContext.setRollBackOnly()
   
    My SQLMapConfig for connection info goes like this.
    I am not using any JNDI look up to the Application server to get the datasource.
 
SQLMapconfig.xml
---------------------------
 
<transactionManager type="JDBC">
    <dataSource type="SIMPLE">
        <property name="JDBC.Driver" value="oracle.jdbc.driver.OracleDriver "/>
        <property name="JDBC.ConnectionURL" value="jdbc:oracle:thin:@machname:1521:sid"/>
        <property name="JDBC.Username" value="${ username}"/>
        <property name="JDBC.Password" value="${password}"/>
        <property name="JDBC.DefaultAutoCommit " value="true" />
        <property name="Pool.MaximumActiveConnections" value="10"/>
        <property name="Pool.MaximumIdleConnections" value="5"/>
        <property name="Pool.MaximumCheckoutTime" value="120000"/>
    </dataSource>
  </transactionManager>
 
 
Thanks in advance...
Vijai Senthil P K


Reply via email to