You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Brad Thompson <br...@vecna.com> on 2002/03/01 05:50:48 UTC

Tyrex pooling issues (Tomcat 4.0.2)

I wanted to use tyrex to pool JNDI-acquired JDBC connections.  I have
attached a file called "diary" that explains how I ultimately got this
working.  Unfortunately, this required several undesirable things.  First,
I had to specify a tomcat-specific class (tyrex.jdbc.ServerDataSource)
in my web.xml.  Second, I had to patch the source to ResourceFactory.java
(patch attached in ResourceFactory-pool-patch).  Third, I had to muck
around with security polices, even though I wasn't running under a
security manager (this is a tyrex issue, not a tomcat one, so I'm not
going to go any farther with this).

The fundamental problem is that as far as I can tell, there is no way
to get tyrex to create a ServerDataSource without doing what I did.
The patch tells ResourceFactory to create a ServerDataSource (which
does pooling) instead of an EnabledDataSource (which does not) if the
web.xml-specified class is tyrex.jdbc.ServerDataSource.  It needs to
explicitly specified this way because of the logic around line 214
of TyrexDataSourceFactory.java.

So, I think the point of this mail is a feature request for a way to
specify that I want a ServerDataSource instead of an EnabledDataSource
when I ask tomcat to give me a javax.sql.DataSource resource.
The attached patch is suboptimal because it requires tomcat-specific
information in web.xml.

I do not know the tomcat source that well...my apologies if I am missing
something important.

brad

Re: Tyrex pooling issues (Tomcat 4.0.2)

Posted by Brad Thompson <br...@vecna.com>.
> Also, to use the transaction manager, you need to get the OTS classes.

I don't use the transaction manager, just the pooling code, and I still
get NoClassDefFoundError's looking for org.omg.CosTransactions.Inactive,
which lives in ots.jar.  Since this seems to be a requirement for using
any tyrex stuff, might it be a good idea to include ots.jar in common/lib
in tomcat 4.0.3?  I assume that the license is not prohibitive because
it ships with the tyrex binary distribution.

brad

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tyrex pooling issues (Tomcat 4.0.2)

Posted by Remy Maucherat <re...@apache.org>.
> I wanted to use tyrex to pool JNDI-acquired JDBC connections.  I have
> attached a file called "diary" that explains how I ultimately got this
> working.  Unfortunately, this required several undesirable things.  First,
> I had to specify a tomcat-specific class (tyrex.jdbc.ServerDataSource)
> in my web.xml.  Second, I had to patch the source to ResourceFactory.java
> (patch attached in ResourceFactory-pool-patch).  Third, I had to muck
> around with security polices, even though I wasn't running under a
> security manager (this is a tyrex issue, not a tomcat one, so I'm not
> going to go any farther with this).

I changed the way the TyrexResourceFactory works (new code will be in 4.0.3
b1), so your patch is no longer needed. Note that you should have been able
to use it by specifying the resourceFactory.

I am aware of the securiy check issue (but can't do much about it).

> The fundamental problem is that as far as I can tell, there is no way
> to get tyrex to create a ServerDataSource without doing what I did.
> The patch tells ResourceFactory to create a ServerDataSource (which
> does pooling) instead of an EnabledDataSource (which does not) if the
> web.xml-specified class is tyrex.jdbc.ServerDataSource.  It needs to
> explicitly specified this way because of the logic around line 214
> of TyrexDataSourceFactory.java.
>
> So, I think the point of this mail is a feature request for a way to
> specify that I want a ServerDataSource instead of an EnabledDataSource
> when I ask tomcat to give me a javax.sql.DataSource resource.
> The attached patch is suboptimal because it requires tomcat-specific
> information in web.xml.

Also, to use the transaction manager, you need to get the OTS classes.

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>