ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Henrique Ferreira e Silva <dhsi...@gmail.com>
Subject Re: How to use tomcat's naming-factory-dbcp.jar
Date Fri, 21 Oct 2005 11:17:00 GMT
Zsolt,

Why do you have to use tomcat's DBCP? I mean, today your app ships
with Tomcat, and if you want to ship it tomorrow with Resin?

Honestly, i don't see any good in using Tomcat embedded libs as that
would tie you to the versions that Tomcat uses. Had been there, done
that, and will never do it again! ;-)

A killer solution, imho, is to make your app uses its very own pooling
library (DBCP or any other you want) and then implement some MBeans
allowing you to change config on the fly. MBeans are one of the
prettiest features of J2EE nowadays.

By the way, does anyone have best practices for MBeans usage?

Hope that helped,
Daniel Silva.






On 10/21/05, Zsolt <zkoppanylist@intland.com> wrote:
> Does it mean that I cannot use directly the tomcat dbcp library?
>
> zsolt
>
> >-----Original Message-----
> >From: Niels Beekman [mailto:n.beekman@wis.nl]
> >Sent: Friday, October 21, 2005 10:14 AM
> >To: user-java@ibatis.apache.org
> >Subject: RE: How to use tomcat's naming-factory-dbcp.jar
> >
> >Ok, then you probably have to write your own transactionmanager and put
> >the following in your SQLMap config.xml:
> >
> ><transactionManager type="mypackage.TomcatDbcpTransactionConfig">
> >  <dataSource type="mypackage.TomcatDbcpDataSourceFactory">
> >    <property name="prop1" value="value1"/>
> >    <property name="prop2" value="value2"/>
> >  </dataSource>
> ></transactionManager>
> >
> >This requires implementations of:
> >- com.ibatis.sqlmap.engine.transaction.TransactionConfig (extend
> >com.ibatis.sqlmap.engine.transaction.BaseTransactionConfig)
> >- com.ibatis.sqlmap.engine.datasource.DataSourceFactory
> >
> >Maybe there is some documentation at the Tomcat-site about the
> >DBCP-package, I suspect it is almost a copy of the DBCP-implementation.
> >
> >Not sure if this is the preferred way to go though, I don't know if your
> >datasources would be accessible in Tomcat too.
> >
> >Hope this helps,
> >
> >Niels
> >
> >-----Original Message-----
> >From: Zsolt [mailto:zkoppanylist@intland.com]
> >Sent: vrijdag 21 oktober 2005 10:05
> >To: user-java@ibatis.apache.org
> >Subject: RE: How to use tomcat's naming-factory-dbcp.jar
> >
> >Thank you Niels, but I would like configure the database connection in
> >sqlmap-config.xml. Because we ship our application with tomcat it would
> >be
> >easier if we could configure ibatis to use naming-factory-dbcp.jar that
> >is
> >always there.
> >
> >Zsolt
> >
> >
> >>-----Original Message-----
> >>From: Niels Beekman [mailto:n.beekman@wis.nl]
> >>Sent: Friday, October 21, 2005 9:16 AM
> >>To: user-java@ibatis.apache.org
> >>Subject: RE: How to use tomcat's naming-factory-dbcp.jar
> >>
> >>You should reference the datasources defined in Tomcat using JNDI, this
> >>can be found in the documentation.
> >>
> >>Niels
> >>
> >>-----Original Message-----
> >>From: Zsolt [mailto:zkoppanylist@intland.com]
> >>Sent: vrijdag 21 oktober 2005 9:15
> >>To: user-java@ibatis.apache.org
> >>Subject: How to use tomcat's naming-factory-dbcp.jar
> >>
> >>Hi,
> >>
> >>I use tc-5.5.12 and that is shipped with naming-factory-dbcp.jar. It
> >>looks
> >>like it has new class names such as:
> >>org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
> >>
> >>How do I have to configure sqlmap-config.xml to use this library?
> >>
> >>Zsolt
> >>
> >>
>
>
>

Mime
View raw message