Hello Georg,
Thanks for your suggestion. I instantiated the datasource in the
ejbCreate() method (via the JNDI lookup), and got the following results:
5457 ms.
5268 ms.
5398 ms.
It shaved roughly a second off the time required to do 1000 transactions, so
I guess it's safe to say that, in this case, the JNDI lookup was taking
about .001 second.
Every little bit helps!!
Take care,
Brian
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Georg
Rehfeld
Sent: Monday, May 21, 2001 11:19 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Interesting test of JDBC pooling
Hi Brian,
> Here is the source for the session bean using connection pooling:
as others pointed out and you confirmed them to be right,
giving back the connections into the pool by executing
connection.close() speeds up your processing essentially.
But you not only test the speed of the connection pool, but
at the same time the speed of a JNDI lookup: your getName()
calls getConnection() which in turn not only gets the connection
but also creates a new InitialContext and does a lookup of
your datasource.
I would do the InitialContext.lookup() thing only once and
cache the DataSource to avoid further lookups. Pooled are
the Connections, that is the tight resource, not the DataSource.
And I would be very interested in your test results after that
modification, so we all can better see the overhead of lookup
vs. connection pooling.
___ ___
| + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg
|_|_\ |___ [EMAIL PROTECTED] +49 (40) 23 53 27 10
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user