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 SonyRaymond <pp...@hotmail.com> on 2008/08/08 17:20:02 UTC
Close Connection after use?
Hi,
I experience the following situation when using iBatis 2.2 with WebSphere
5.1 JNDI datasource, closing database connection after use will make the
next getConnection() call gives error exception? (Connection
is closed!)
Is it normal?
Thanks,
Raymond
--
View this message in context: http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
Re: Close Connection after use?
Posted by SonyRaymond <pp...@hotmail.com>.
Any difference between the two versions? I found that ibatis should only just
call the
JNDI datasource and return a connection to applications. Then why
connection.close()
will generate an exception?
As it is normal (or good practice) to close connection after use such that
the connection
can return to datasource connection pool.
Thanks,
Raymond
Clinton Begin wrote:
>
> Can you upgrade to 2.3.3 or at least 2.3.0?
>
> On Mon, Aug 18, 2008 at 10:45 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
>>
>> No spring or EJB has been used. Only common JDBC calls
>>
>> This is my dao.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE daoConfig PUBLIC "-//iBATIS.com//DTD DAO Configuration 2.0//EN"
>> "http://www.ibatis.com/dtd/dao-2.dtd">
>> <daoConfig>
>> <context>
>> <transactionManager type="JDBC">
>> <property name="DataSource" value="JNDI"/>
>> <property name="DBJndiContext"
>> value="java:comp/env/jdbc/datasource-mssql"/>
>> </transactionManager>
>> <dao interface="com.aiab.iso.dbaccess.isoDaoIF"
>> implementation="com.aiab.iso.dbaccess.isoDaoJdbc" />
>> </context>
>> <context>
>> <transactionManager type="JDBC">
>> <property name="DataSource" value="JNDI"/>
>> <property name="DBJndiContext"
>> value="java:comp/env/jdbc/datasource-sybase"/>
>> </transactionManager>
>> <dao interface="com.aiab.iso.dbaccess.isoSybaseDaoIF"
>> implementation="com.aiab.iso.dbaccess.isoSybaseDaoJdbc"/>
>> </context>
>> </daoConfig>
>>
>> Exception : com.ibatis.dao.client.DaoException: Error ending JDBC
>> transaction. Cause: com.ibm.websphere.ce.cm.ObjectClosedException:
>> DSRA9110E: Connection is closed.
>>
>> This exception is raised when "conn.close()" is executed. ** Where conn
>> is
>> SQLConnection
>>
>> I use MSSQL JDBC Driver for this testing.
>>
>> Any help??
>>
>> Thanks in advance,
>> Raymond
>>
>>
>> Clinton Begin wrote:
>> >
>> > Certainly not... :-)
>> >
>> > We'll need more information about your configuration:
>> >
>> > Which transaction manager are you using? Which data source? Which
>> > database
>> > driver
>> >
>> > Are you using Spring or EJB?
>> >
>> > Clinton
>> >
>> > On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com> wrote:
>> >
>> >>
>> >> Hi,
>> >>
>> >> I experience the following situation when using iBatis 2.2 with
>> WebSphere
>> >> 5.1 JNDI datasource, closing database connection after use will make
>> the
>> >> next getConnection() call gives error exception? (Connection
>> >> is closed!)
>> >>
>> >> Is it normal?
>> >>
>> >> Thanks,
>> >> Raymond
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
>> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p19035411.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Close-Connection-after-use--tp18893861p19110912.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
Re: Close Connection after use?
Posted by Clinton Begin <cl...@gmail.com>.
PS: The DAO Framework can still be downloaded separately... See the right
sidebar on the download page....
http://ibatis.apache.org/javadownloads.cgi
Clinton
On Mon, Aug 18, 2008 at 2:20 PM, Clinton Begin <cl...@gmail.com>wrote:
> Can you upgrade to 2.3.3 or at least 2.3.0?
>
>
> On Mon, Aug 18, 2008 at 10:45 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
>>
>> No spring or EJB has been used. Only common JDBC calls
>>
>> This is my dao.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE daoConfig PUBLIC "-//iBATIS.com//DTD DAO Configuration 2.0//EN"
>> "http://www.ibatis.com/dtd/dao-2.dtd">
>> <daoConfig>
>> <context>
>> <transactionManager type="JDBC">
>> <property name="DataSource" value="JNDI"/>
>> <property name="DBJndiContext"
>> value="java:comp/env/jdbc/datasource-mssql"/>
>> </transactionManager>
>> <dao interface="com.aiab.iso.dbaccess.isoDaoIF"
>> implementation="com.aiab.iso.dbaccess.isoDaoJdbc" />
>> </context>
>> <context>
>> <transactionManager type="JDBC">
>> <property name="DataSource" value="JNDI"/>
>> <property name="DBJndiContext"
>> value="java:comp/env/jdbc/datasource-sybase"/>
>> </transactionManager>
>> <dao interface="com.aiab.iso.dbaccess.isoSybaseDaoIF"
>> implementation="com.aiab.iso.dbaccess.isoSybaseDaoJdbc"/>
>> </context>
>> </daoConfig>
>>
>> Exception : com.ibatis.dao.client.DaoException: Error ending JDBC
>> transaction. Cause: com.ibm.websphere.ce.cm.ObjectClosedException:
>> DSRA9110E: Connection is closed.
>>
>> This exception is raised when "conn.close()" is executed. ** Where conn is
>> SQLConnection
>>
>> I use MSSQL JDBC Driver for this testing.
>>
>> Any help??
>>
>> Thanks in advance,
>> Raymond
>>
>>
>> Clinton Begin wrote:
>> >
>> > Certainly not... :-)
>> >
>> > We'll need more information about your configuration:
>> >
>> > Which transaction manager are you using? Which data source? Which
>> > database
>> > driver
>> >
>> > Are you using Spring or EJB?
>> >
>> > Clinton
>> >
>> > On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com> wrote:
>> >
>> >>
>> >> Hi,
>> >>
>> >> I experience the following situation when using iBatis 2.2 with
>> WebSphere
>> >> 5.1 JNDI datasource, closing database connection after use will make
>> the
>> >> next getConnection() call gives error exception? (Connection
>> >> is closed!)
>> >>
>> >> Is it normal?
>> >>
>> >> Thanks,
>> >> Raymond
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
>> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p19035411.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>
Re: Close Connection after use?
Posted by Clinton Begin <cl...@gmail.com>.
Can you upgrade to 2.3.3 or at least 2.3.0?
On Mon, Aug 18, 2008 at 10:45 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
> No spring or EJB has been used. Only common JDBC calls
>
> This is my dao.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE daoConfig PUBLIC "-//iBATIS.com//DTD DAO Configuration 2.0//EN"
> "http://www.ibatis.com/dtd/dao-2.dtd">
> <daoConfig>
> <context>
> <transactionManager type="JDBC">
> <property name="DataSource" value="JNDI"/>
> <property name="DBJndiContext"
> value="java:comp/env/jdbc/datasource-mssql"/>
> </transactionManager>
> <dao interface="com.aiab.iso.dbaccess.isoDaoIF"
> implementation="com.aiab.iso.dbaccess.isoDaoJdbc" />
> </context>
> <context>
> <transactionManager type="JDBC">
> <property name="DataSource" value="JNDI"/>
> <property name="DBJndiContext"
> value="java:comp/env/jdbc/datasource-sybase"/>
> </transactionManager>
> <dao interface="com.aiab.iso.dbaccess.isoSybaseDaoIF"
> implementation="com.aiab.iso.dbaccess.isoSybaseDaoJdbc"/>
> </context>
> </daoConfig>
>
> Exception : com.ibatis.dao.client.DaoException: Error ending JDBC
> transaction. Cause: com.ibm.websphere.ce.cm.ObjectClosedException:
> DSRA9110E: Connection is closed.
>
> This exception is raised when "conn.close()" is executed. ** Where conn is
> SQLConnection
>
> I use MSSQL JDBC Driver for this testing.
>
> Any help??
>
> Thanks in advance,
> Raymond
>
>
> Clinton Begin wrote:
> >
> > Certainly not... :-)
> >
> > We'll need more information about your configuration:
> >
> > Which transaction manager are you using? Which data source? Which
> > database
> > driver
> >
> > Are you using Spring or EJB?
> >
> > Clinton
> >
> > On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com> wrote:
> >
> >>
> >> Hi,
> >>
> >> I experience the following situation when using iBatis 2.2 with
> WebSphere
> >> 5.1 JNDI datasource, closing database connection after use will make the
> >> next getConnection() call gives error exception? (Connection
> >> is closed!)
> >>
> >> Is it normal?
> >>
> >> Thanks,
> >> Raymond
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Close-Connection-after-use--tp18893861p19035411.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
Re: Close Connection after use?
Posted by Jeff Butler <je...@gmail.com>.
Also - look here for advice on configuing iBATIS with WebSphere:
http://opensource.atlassian.com/confluence/oss/display/IBATIS/Environment+Specific+Information
WebSphere requires that all transactions be committed, so you need to
configure iBATIS appropriately.
Jeff Butler
On Fri, Aug 22, 2008 at 11:58 AM, Jeff Butler <je...@gmail.com> wrote:
> iBATIS calls connection.close() at the end of a transaction. If you are
> using explicit transactions, it happens when you call the endTransaction()
> method. If you are not coding explicit transactions, then it happens at the
> end of the sqlMap methods like queryForList, insert, etc.
>
> You are using a JNDI datasource. This means that connection.close() DOES
> NOT actually close the connection - it merely returns the connection to the
> pool. The datasource is holding the connection open for reuse. If the
> datasource is holding connections open too long for your liking, then you
> must change the parameters of the datasource (this is outside the scope of
> iBATIS).
>
> BTW - look in the org.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction
> class for connection.close() in iBATIS. The garbage collector certainly
> does not close connections.
>
> Jeff Butler
>
> On Fri, Aug 22, 2008 at 11:31 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
>>
>> Hi,
>>
>> Do you know when it will close the connection? We are facing a situation
>> that there are too many connections not closed after a long running of
>> applications, such that sometimes connections are not available to other
>> applications. I am not sure whether ibatis will close the connection
>> automatically, as I have browsed the source code that not found any coding
>> or framework that do this "close" connection job.
>>
>> I guess the connections are closed by the Garbage collector but not under
>> control by ibatis.
>>
>> Any experts can comment on this?
>>
>> Thanks,
>> Raymond
>>
>>
>> Jeff Butler-2 wrote:
>> >
>> > Why are you calling conn.close()? iBATIS closes connections
>> > automatically.
>> >
>> > Jeff Butler
>> >
>> > On Mon, Aug 18, 2008 at 11:45 AM, SonyRaymond <pp...@hotmail.com>
>> wrote:
>> >
>> >>
>> >> No spring or EJB has been used. Only common JDBC calls
>> >>
>> >> This is my dao.xml
>> >>
>> >> <?xml version="1.0" encoding="UTF-8"?>
>> >> <!DOCTYPE daoConfig PUBLIC "-//iBATIS.com//DTD DAO Configuration
>> 2.0//EN"
>> >> "http://www.ibatis.com/dtd/dao-2.dtd">
>> >> <daoConfig>
>> >> <context>
>> >> <transactionManager type="JDBC">
>> >> <property name="DataSource" value="JNDI"/>
>> >> <property name="DBJndiContext"
>> >> value="java:comp/env/jdbc/datasource-mssql"/>
>> >> </transactionManager>
>> >> <dao interface="com.aiab.iso.dbaccess.isoDaoIF"
>> >> implementation="com.aiab.iso.dbaccess.isoDaoJdbc" />
>> >> </context>
>> >> <context>
>> >> <transactionManager type="JDBC">
>> >> <property name="DataSource" value="JNDI"/>
>> >> <property name="DBJndiContext"
>> >> value="java:comp/env/jdbc/datasource-sybase"/>
>> >> </transactionManager>
>> >> <dao interface="com.aiab.iso.dbaccess.isoSybaseDaoIF"
>> >> implementation="com.aiab.iso.dbaccess.isoSybaseDaoJdbc"/>
>> >> </context>
>> >> </daoConfig>
>> >>
>> >> Exception : com.ibatis.dao.client.DaoException: Error ending JDBC
>> >> transaction. Cause: com.ibm.websphere.ce.cm.ObjectClosedException:
>> >> DSRA9110E: Connection is closed.
>> >>
>> >> This exception is raised when "conn.close()" is executed. ** Where conn
>> >> is
>> >> SQLConnection
>> >>
>> >> I use MSSQL JDBC Driver for this testing.
>> >>
>> >> Any help??
>> >>
>> >> Thanks in advance,
>> >> Raymond
>> >>
>> >>
>> >> Clinton Begin wrote:
>> >> >
>> >> > Certainly not... :-)
>> >> >
>> >> > We'll need more information about your configuration:
>> >> >
>> >> > Which transaction manager are you using? Which data source? Which
>> >> > database
>> >> > driver
>> >> >
>> >> > Are you using Spring or EJB?
>> >> >
>> >> > Clinton
>> >> >
>> >> > On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com>
>> wrote:
>> >> >
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> I experience the following situation when using iBatis 2.2 with
>> >> WebSphere
>> >> >> 5.1 JNDI datasource, closing database connection after use will make
>> >> the
>> >> >> next getConnection() call gives error exception? (Connection
>> >> >> is closed!)
>> >> >>
>> >> >> Is it normal?
>> >> >>
>> >> >> Thanks,
>> >> >> Raymond
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
>> >> >> Sent from the iBATIS - User - Java mailing list archive at
>> Nabble.com.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p19035411.html
>> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p19110838.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>
Re: Close Connection after use?
Posted by Jeff Butler <je...@gmail.com>.
iBATIS calls connection.close() at the end of a transaction. If you are
using explicit transactions, it happens when you call the endTransaction()
method. If you are not coding explicit transactions, then it happens at the
end of the sqlMap methods like queryForList, insert, etc.
You are using a JNDI datasource. This means that connection.close() DOES
NOT actually close the connection - it merely returns the connection to the
pool. The datasource is holding the connection open for reuse. If the
datasource is holding connections open too long for your liking, then you
must change the parameters of the datasource (this is outside the scope of
iBATIS).
BTW - look in the org.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction
class for connection.close() in iBATIS. The garbage collector certainly
does not close connections.
Jeff Butler
On Fri, Aug 22, 2008 at 11:31 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
> Hi,
>
> Do you know when it will close the connection? We are facing a situation
> that there are too many connections not closed after a long running of
> applications, such that sometimes connections are not available to other
> applications. I am not sure whether ibatis will close the connection
> automatically, as I have browsed the source code that not found any coding
> or framework that do this "close" connection job.
>
> I guess the connections are closed by the Garbage collector but not under
> control by ibatis.
>
> Any experts can comment on this?
>
> Thanks,
> Raymond
>
>
> Jeff Butler-2 wrote:
> >
> > Why are you calling conn.close()? iBATIS closes connections
> > automatically.
> >
> > Jeff Butler
> >
> > On Mon, Aug 18, 2008 at 11:45 AM, SonyRaymond <pp...@hotmail.com> wrote:
> >
> >>
> >> No spring or EJB has been used. Only common JDBC calls
> >>
> >> This is my dao.xml
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <!DOCTYPE daoConfig PUBLIC "-//iBATIS.com//DTD DAO Configuration
> 2.0//EN"
> >> "http://www.ibatis.com/dtd/dao-2.dtd">
> >> <daoConfig>
> >> <context>
> >> <transactionManager type="JDBC">
> >> <property name="DataSource" value="JNDI"/>
> >> <property name="DBJndiContext"
> >> value="java:comp/env/jdbc/datasource-mssql"/>
> >> </transactionManager>
> >> <dao interface="com.aiab.iso.dbaccess.isoDaoIF"
> >> implementation="com.aiab.iso.dbaccess.isoDaoJdbc" />
> >> </context>
> >> <context>
> >> <transactionManager type="JDBC">
> >> <property name="DataSource" value="JNDI"/>
> >> <property name="DBJndiContext"
> >> value="java:comp/env/jdbc/datasource-sybase"/>
> >> </transactionManager>
> >> <dao interface="com.aiab.iso.dbaccess.isoSybaseDaoIF"
> >> implementation="com.aiab.iso.dbaccess.isoSybaseDaoJdbc"/>
> >> </context>
> >> </daoConfig>
> >>
> >> Exception : com.ibatis.dao.client.DaoException: Error ending JDBC
> >> transaction. Cause: com.ibm.websphere.ce.cm.ObjectClosedException:
> >> DSRA9110E: Connection is closed.
> >>
> >> This exception is raised when "conn.close()" is executed. ** Where conn
> >> is
> >> SQLConnection
> >>
> >> I use MSSQL JDBC Driver for this testing.
> >>
> >> Any help??
> >>
> >> Thanks in advance,
> >> Raymond
> >>
> >>
> >> Clinton Begin wrote:
> >> >
> >> > Certainly not... :-)
> >> >
> >> > We'll need more information about your configuration:
> >> >
> >> > Which transaction manager are you using? Which data source? Which
> >> > database
> >> > driver
> >> >
> >> > Are you using Spring or EJB?
> >> >
> >> > Clinton
> >> >
> >> > On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com>
> wrote:
> >> >
> >> >>
> >> >> Hi,
> >> >>
> >> >> I experience the following situation when using iBatis 2.2 with
> >> WebSphere
> >> >> 5.1 JNDI datasource, closing database connection after use will make
> >> the
> >> >> next getConnection() call gives error exception? (Connection
> >> >> is closed!)
> >> >>
> >> >> Is it normal?
> >> >>
> >> >> Thanks,
> >> >> Raymond
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
> >> >> Sent from the iBATIS - User - Java mailing list archive at
> Nabble.com.
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Close-Connection-after-use--tp18893861p19035411.html
> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Close-Connection-after-use--tp18893861p19110838.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
Re: Close Connection after use?
Posted by SonyRaymond <pp...@hotmail.com>.
Hi,
Do you know when it will close the connection? We are facing a situation
that there are too many connections not closed after a long running of
applications, such that sometimes connections are not available to other
applications. I am not sure whether ibatis will close the connection
automatically, as I have browsed the source code that not found any coding
or framework that do this "close" connection job.
I guess the connections are closed by the Garbage collector but not under
control by ibatis.
Any experts can comment on this?
Thanks,
Raymond
Jeff Butler-2 wrote:
>
> Why are you calling conn.close()? iBATIS closes connections
> automatically.
>
> Jeff Butler
>
> On Mon, Aug 18, 2008 at 11:45 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
>>
>> No spring or EJB has been used. Only common JDBC calls
>>
>> This is my dao.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE daoConfig PUBLIC "-//iBATIS.com//DTD DAO Configuration 2.0//EN"
>> "http://www.ibatis.com/dtd/dao-2.dtd">
>> <daoConfig>
>> <context>
>> <transactionManager type="JDBC">
>> <property name="DataSource" value="JNDI"/>
>> <property name="DBJndiContext"
>> value="java:comp/env/jdbc/datasource-mssql"/>
>> </transactionManager>
>> <dao interface="com.aiab.iso.dbaccess.isoDaoIF"
>> implementation="com.aiab.iso.dbaccess.isoDaoJdbc" />
>> </context>
>> <context>
>> <transactionManager type="JDBC">
>> <property name="DataSource" value="JNDI"/>
>> <property name="DBJndiContext"
>> value="java:comp/env/jdbc/datasource-sybase"/>
>> </transactionManager>
>> <dao interface="com.aiab.iso.dbaccess.isoSybaseDaoIF"
>> implementation="com.aiab.iso.dbaccess.isoSybaseDaoJdbc"/>
>> </context>
>> </daoConfig>
>>
>> Exception : com.ibatis.dao.client.DaoException: Error ending JDBC
>> transaction. Cause: com.ibm.websphere.ce.cm.ObjectClosedException:
>> DSRA9110E: Connection is closed.
>>
>> This exception is raised when "conn.close()" is executed. ** Where conn
>> is
>> SQLConnection
>>
>> I use MSSQL JDBC Driver for this testing.
>>
>> Any help??
>>
>> Thanks in advance,
>> Raymond
>>
>>
>> Clinton Begin wrote:
>> >
>> > Certainly not... :-)
>> >
>> > We'll need more information about your configuration:
>> >
>> > Which transaction manager are you using? Which data source? Which
>> > database
>> > driver
>> >
>> > Are you using Spring or EJB?
>> >
>> > Clinton
>> >
>> > On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com> wrote:
>> >
>> >>
>> >> Hi,
>> >>
>> >> I experience the following situation when using iBatis 2.2 with
>> WebSphere
>> >> 5.1 JNDI datasource, closing database connection after use will make
>> the
>> >> next getConnection() call gives error exception? (Connection
>> >> is closed!)
>> >>
>> >> Is it normal?
>> >>
>> >> Thanks,
>> >> Raymond
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
>> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p19035411.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Close-Connection-after-use--tp18893861p19110838.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
Re: Close Connection after use?
Posted by Jeff Butler <je...@gmail.com>.
Why are you calling conn.close()? iBATIS closes connections automatically.
Jeff Butler
On Mon, Aug 18, 2008 at 11:45 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
> No spring or EJB has been used. Only common JDBC calls
>
> This is my dao.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE daoConfig PUBLIC "-//iBATIS.com//DTD DAO Configuration 2.0//EN"
> "http://www.ibatis.com/dtd/dao-2.dtd">
> <daoConfig>
> <context>
> <transactionManager type="JDBC">
> <property name="DataSource" value="JNDI"/>
> <property name="DBJndiContext"
> value="java:comp/env/jdbc/datasource-mssql"/>
> </transactionManager>
> <dao interface="com.aiab.iso.dbaccess.isoDaoIF"
> implementation="com.aiab.iso.dbaccess.isoDaoJdbc" />
> </context>
> <context>
> <transactionManager type="JDBC">
> <property name="DataSource" value="JNDI"/>
> <property name="DBJndiContext"
> value="java:comp/env/jdbc/datasource-sybase"/>
> </transactionManager>
> <dao interface="com.aiab.iso.dbaccess.isoSybaseDaoIF"
> implementation="com.aiab.iso.dbaccess.isoSybaseDaoJdbc"/>
> </context>
> </daoConfig>
>
> Exception : com.ibatis.dao.client.DaoException: Error ending JDBC
> transaction. Cause: com.ibm.websphere.ce.cm.ObjectClosedException:
> DSRA9110E: Connection is closed.
>
> This exception is raised when "conn.close()" is executed. ** Where conn is
> SQLConnection
>
> I use MSSQL JDBC Driver for this testing.
>
> Any help??
>
> Thanks in advance,
> Raymond
>
>
> Clinton Begin wrote:
> >
> > Certainly not... :-)
> >
> > We'll need more information about your configuration:
> >
> > Which transaction manager are you using? Which data source? Which
> > database
> > driver
> >
> > Are you using Spring or EJB?
> >
> > Clinton
> >
> > On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com> wrote:
> >
> >>
> >> Hi,
> >>
> >> I experience the following situation when using iBatis 2.2 with
> WebSphere
> >> 5.1 JNDI datasource, closing database connection after use will make the
> >> next getConnection() call gives error exception? (Connection
> >> is closed!)
> >>
> >> Is it normal?
> >>
> >> Thanks,
> >> Raymond
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Close-Connection-after-use--tp18893861p19035411.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
Re: Close Connection after use?
Posted by SonyRaymond <pp...@hotmail.com>.
No spring or EJB has been used. Only common JDBC calls
This is my dao.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE daoConfig PUBLIC "-//iBATIS.com//DTD DAO Configuration 2.0//EN"
"http://www.ibatis.com/dtd/dao-2.dtd">
<daoConfig>
<context>
<transactionManager type="JDBC">
<property name="DataSource" value="JNDI"/>
<property name="DBJndiContext"
value="java:comp/env/jdbc/datasource-mssql"/>
</transactionManager>
<dao interface="com.aiab.iso.dbaccess.isoDaoIF"
implementation="com.aiab.iso.dbaccess.isoDaoJdbc" />
</context>
<context>
<transactionManager type="JDBC">
<property name="DataSource" value="JNDI"/>
<property name="DBJndiContext"
value="java:comp/env/jdbc/datasource-sybase"/>
</transactionManager>
<dao interface="com.aiab.iso.dbaccess.isoSybaseDaoIF"
implementation="com.aiab.iso.dbaccess.isoSybaseDaoJdbc"/>
</context>
</daoConfig>
Exception : com.ibatis.dao.client.DaoException: Error ending JDBC
transaction. Cause: com.ibm.websphere.ce.cm.ObjectClosedException:
DSRA9110E: Connection is closed.
This exception is raised when "conn.close()" is executed. ** Where conn is
SQLConnection
I use MSSQL JDBC Driver for this testing.
Any help??
Thanks in advance,
Raymond
Clinton Begin wrote:
>
> Certainly not... :-)
>
> We'll need more information about your configuration:
>
> Which transaction manager are you using? Which data source? Which
> database
> driver
>
> Are you using Spring or EJB?
>
> Clinton
>
> On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
>>
>> Hi,
>>
>> I experience the following situation when using iBatis 2.2 with WebSphere
>> 5.1 JNDI datasource, closing database connection after use will make the
>> next getConnection() call gives error exception? (Connection
>> is closed!)
>>
>> Is it normal?
>>
>> Thanks,
>> Raymond
>> --
>> View this message in context:
>> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Close-Connection-after-use--tp18893861p19035411.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
Re: Close Connection after use?
Posted by Clinton Begin <cl...@gmail.com>.
Certainly not... :-)
We'll need more information about your configuration:
Which transaction manager are you using? Which data source? Which database
driver
Are you using Spring or EJB?
Clinton
On Fri, Aug 8, 2008 at 9:20 AM, SonyRaymond <pp...@hotmail.com> wrote:
>
> Hi,
>
> I experience the following situation when using iBatis 2.2 with WebSphere
> 5.1 JNDI datasource, closing database connection after use will make the
> next getConnection() call gives error exception? (Connection
> is closed!)
>
> Is it normal?
>
> Thanks,
> Raymond
> --
> View this message in context:
> http://www.nabble.com/Close-Connection-after-use--tp18893861p18893861.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>