You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Folashade Adeyosoye <sh...@gmail.com> on 2005/05/16 17:29:12 UTC

iBatis DAO - How to turn off data connection pool

How can I turn off the Database connection pool in the dao.xml

 

 

   <transactionManager type="JDBC">

      <property name="DataSource" value="SIMPLE"/>

      <property name="JDBC.Driver" value="${driver}"/>

      <property name="JDBC.ConnectionURL" value="${url}"/>

      <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"/>

    </transactionManager>

 

 

 

I tried changing the       <property name="Pool.MaximumActiveConnections"
value="0"/> and   <property name="Pool.MaximumIdleConnections" value="0"/>,
but I got an exception

 

 

exception is thrown - java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

 

 

Thanks


Re: iBatis DAO - How to turn off data connection pool

Posted by Brandon Goodin <br...@gmail.com>.
There really is no simple answer to what you need. I believe we have
discussed your dilemna in the past haven't we? The answer is the
same... Bite the bullet and swap out your connection manager with a
common connection manager so that both implementations use the same
connection manager. This path would be much simpler than trying all
the gyrations that you are at the moment.

Brandon.



On 5/17/05, Folashade Adeyosoye <sh...@gmail.com> wrote:
>  
>  
> 
> Thanks for your response, I have actually been battling this for a while,
> this is my situation. 
> 
>   
>  
> I currently have a system that works, but with embedded SQL in my classes,
> and the classes and implementation are well separated using interfaces and
> implementation classes. (   Action classes à API calls that delegates à   
> JDBC implementation classes) 
> I am trying to swap out my written DAO pattern with the iBatis DAO 
> Add an alternative SQLMAP implementation and also keep around my old
> embedded SQL JDBC classes 
> The JDBC classes do not use JNDI to lookup the database connections, I have
> a DatabaseConnection Manager class that creates a pool of up to 20
> connections and manages them 
> Right now I just need the DAO part to work with out using the SQLMAP
> portion, this is a future task to do. 
> 
>   
> 
> And I would like to basically use the dao.xml to switch between both
> implementations. 
> 
>   
> 
> Thanks 
> 
>   
>  
>  ________________________________
>  
> 
> From: Clinton Begin [mailto:clinton.begin@gmail.com] 
>  Sent: Monday, May 16, 2005 4:03 PM
>  To: ibatis-user-java@incubator.apache.org
>  Subject: Re: iBatis DAO - How to turn off data connection pool 
>  
> 
>   
> 
> 
>  What are you trying to achieve by doing that?  You can't really "turn off"
> pooling with SimpleDataSource, but you could try one of the other
> implementations or write your own to achieve that.  
>  
>  Cheers,
>  Clinton
>  
>  
>  
> 
> On 5/16/05, Folashade Adeyosoye <sh...@gmail.com> wrote: 
>  
> 
> How can I turn off the Database connection pool in the dao.xml 
> 
>   
> 
>   
> 
>    <transactionManager type="JDBC"> 
> 
>       <property name="DataSource" value="SIMPLE"/> 
> 
>       <property name="JDBC.Driver" value="${driver}"/> 
> 
>       <property name="JDBC.ConnectionURL" value="${url}"/> 
> 
>       <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"/> 
> 
>     </transactionManager> 
> 
>   
> 
>   
> 
>   
> 
> I tried changing the       <property name="Pool.MaximumActiveConnections"
> value="0"/> and   <property name="Pool.MaximumIdleConnections" value="0"/>,
> but I got an exception 
> 
>   
> 
>   
> 
> exception is thrown - java.lang.IndexOutOfBoundsException:
> Index: 0, Size: 0 
> 
>   
> 
>   
> 
> Thanks 
> 
>

RE: iBatis DAO - How to turn off data connection pool

Posted by Folashade Adeyosoye <sh...@gmail.com>.
Thanks for your response, I have actually been battling this for a while,
this is my situation.

 

1.	I currently have a system that works, but with embedded SQL in my
classes, and the classes and implementation are well separated using
interfaces and implementation classes. (   Action classes --> API calls that
delegates -->    JDBC implementation classes)
2.	I am trying to swap out my written DAO pattern with the iBatis DAO
3.	Add an alternative SQLMAP implementation and also keep around my old
embedded SQL JDBC classes
4.	The JDBC classes do not use JNDI to lookup the database connections,
I have a DatabaseConnection Manager class that creates a pool of up to 20
connections and manages them
5.	Right now I just need the DAO part to work with out using the SQLMAP
portion, this is a future task to do.

 

And I would like to basically use the dao.xml to switch between both
implementations.

 

Thanks

 

  _____  

From: Clinton Begin [mailto:clinton.begin@gmail.com] 
Sent: Monday, May 16, 2005 4:03 PM
To: ibatis-user-java@incubator.apache.org
Subject: Re: iBatis DAO - How to turn off data connection pool

 


What are you trying to achieve by doing that?  You can't really "turn off"
pooling with SimpleDataSource, but you could try one of the other
implementations or write your own to achieve that.  

Cheers,
Clinton



On 5/16/05, Folashade Adeyosoye <sh...@gmail.com> wrote:

How can I turn off the Database connection pool in the dao.xml

 

 

   <transactionManager type="JDBC">

      <property name="DataSource" value="SIMPLE"/>

      <property name="JDBC.Driver" value="${driver}"/>

      <property name="JDBC.ConnectionURL" value="${url}"/>

      <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"/>

    </transactionManager>

 

 

 

I tried changing the       <property name="Pool.MaximumActiveConnections"
value="0"/> and   <property name="Pool.MaximumIdleConnections" value="0"/>,
but I got an exception

 

 

exception is thrown - java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

 

 

Thanks

 


Re: iBatis DAO - How to turn off data connection pool

Posted by Clinton Begin <cl...@gmail.com>.
What are you trying to achieve by doing that? You can't really "turn off" 
pooling with SimpleDataSource, but you could try one of the other 
implementations or write your own to achieve that. 

Cheers,
Clinton


On 5/16/05, Folashade Adeyosoye <sh...@gmail.com> wrote:
> 
>  How can I turn off the Database connection pool in the dao.xml
> 
>   <transactionManager type="JDBC">
> 
> <property name="DataSource" value="SIMPLE"/>
> 
> <property name="JDBC.Driver" value="${driver}"/>
> 
> <property name="JDBC.ConnectionURL" value="${url}"/>
> 
> <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"/>
> 
> </transactionManager>
> 
>    I tried changing the <property name="Pool.MaximumActiveConnections" 
> value="0"/> and <property name="Pool.MaximumIdleConnections" value="0"/>, 
> but I got an exception
> 
>   exception is thrown - java.lang.IndexOutOfBoundsException: Index: 0, 
> Size: 0
> 
>   Thanks
>

Re: iBatis DAO - How to turn off data connection pool

Posted by Brice Ruth <bd...@gmail.com>.
Did you try "1" ?

On 5/16/05, Folashade Adeyosoye <sh...@gmail.com> wrote:
>  
>  
> 
> How can I turn off the Database connection pool in the dao.xml 
> 
>   
> 
>   
> 
>    <transactionManager type="JDBC"> 
> 
>       <property name="DataSource" value="SIMPLE"/> 
> 
>       <property name="JDBC.Driver" value="${driver}"/> 
> 
>       <property name="JDBC.ConnectionURL" value="${url}"/> 
> 
>       <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"/> 
> 
>     </transactionManager> 
> 
>   
> 
>   
> 
>   
> 
> I tried changing the       <property name="Pool.MaximumActiveConnections"
> value="0"/> and   <property name="Pool.MaximumIdleConnections" value="0"/>,
> but I got an exception 
> 
>   
> 
>   
> 
> exception is thrown - java.lang.IndexOutOfBoundsException:
> Index: 0, Size: 0 
> 
>  
> 
>   
> 
>   
> 
> Thanks 


-- 
Brice Ruth
Software Engineer, Madison WI