Subject Re: [IB-Java] Re: Firebird JDBC and database pool
Author David Jencks
If your application does not include a TransactionManager, you will need to
control the transactions yourself, as one normally does with a jdbc 1
driver. In this case you should use a non-transaction-aware
ConnectionManager: if it is transaction aware it will expect to receive
instructions from a transaction manager. If you really need xa
transactions and two phase commit, I strongly recommend you use an ejb
container (of course, I'm going to recommend jboss). In the more likely
case that you do not, the no transaction connection manager from jboss
should work.

Unfortunately I don't have time to test this right now. something like
this ought to work (I think)

The additional classes you need are I think all in the jbosspool.jar from
the jboss 2.4.3 (latest released) jboss distribution (The classes have
mostly moved in the cvs version, 3.0, to jbosspool and jbosscx)

ManagedConnectionFactory mcf = new FBManagedConnectionFactory();
//congfigure database name and username and password - omitted but you need
them

org.jboss.pool.connector.NoTransConnectionManager cm = new
org.jboss.pool.connector.NoTransConnectionManager();
org.jboss.pool.PoolParameters pp = new org.jboss.pool.PoolParameters();
//set the parameters for the pool, min, max, idle timeout, etc. Set
blocking = true!

cm.addPerFactoryPool(mcf, pp);
DataSource ds = (DataSource)mcf.createConnectionFactory(cm);

If you have jndi, you can bind the ds, if you don't, save it somewhere
global.

I think that binding the datasource in jndi only works if the jndi
implementation supports referencable objects rather than just serializable
ones, but I have no good way to test.

Hope this is helpful, sorry I don't have time to help more.

David Jencks

On 2001.10.26 20:25:21 -0400 jwcanada@... wrote:
> David.
>
> Thank you for the excellent work. I would love to contribute.
> However, I am new to java. It would take much longer for me to do
> anything useful to the community.
>
> Currently, our application does not use any EJB staff. Could we still
> use the Jboss xa ConnectionManager to connect the firebird. I really
> would like to try it in a real application for Firebird database.
> Once I got to know all the pieces, certainly I would like to
> contribute to make it one of the best drivers.
>
> Any information or sample for me to get started.
>
> jw
>
> --- In IB-Java@y..., David Jencks <davidjencks@d...> wrote:
> > The jca driver supports pooling via a pluggable ConnectionManager,
> as per
> > the jca spec. Using a pooling system designed for jdbc 1 drivers
> will be
> > at best less than optimal, and I am not very surprised it doesn't
> work.
> > Normally a ConnectionManager is provided as part of an application
> server,
> > and the jca driver has been tested with the jboss xa
> ConnectionManager.
> > The FBStandAloneConnectionManager provided with the driver does not
> do any
> > pooling, it is there to make it easy to use the driver standalone.
> > However, it would be pretty easy to implement a standalone pooling
> > ConnectionManager. Are you interested in contributing such an
> > implementation? I may not get to it very soon. You could probably
> use the
> > MinervaNoTransactionConnectionManager from jboss directly (the
> latest
> > version in cvs is in the jbosscx or connector module), since I
> imagine you
> > are controlling your own transactions.
> >
> > Thanks
> > David Jencks
> >
> > On 2001.10.26 16:31:25 -0400 jwcanada@y... wrote:
> > > Great news. Thank you for the quick help. I managed to build it
> on
> > > Win2K and works.
> > >
> > > One question concerning the database pool. I do not seem to get
> it
> > > work.
> > >
> > > One of our project using Poolman from
> > > http://sourceforge.net/projects/poolman/
> > >
> > > using Interclient and it works fine. However, I could not make it
> > > work with Firebird JDBC. It always raise exception said "Not yet
> > > implemented".
> > >
> > > Any insight we could make it working?
> > >
> > > Thank you!
> > >
> > > jw
> > >
>
>
>
>
> To unsubscribe from this group, send an email to:
> IB-Java-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>