Sagewire Logo

pooling the JDBC connection

2 Message(s) by 2 Author(s) originally posted in java beans


From: timasmith Date:   Monday, May 22, 2006
Hi,

I've entity beans which act purely in a stateless service fashion -
essentially executing SQL and performing business logic and then
returning business objects.

I establish the JDBC connection manually and all the beans *seem* to be
using the same connection since it is accessed statically. I dont know
whether that creates a problem if the beans are all their own threads..
anyway.

I am all for some pooling - I vaguely remember someone suggesting that
standalone JDBC can easily pool for you - without a container or
anything else.

If so I am not sure what I'd get from an EJB datasource beyond some
transaction management possibilities down the road if I cant architect
around it.

So my question is a) can I pool with POJO and b) is it far better to
have the container do it?

Note I generate and execute my own SQL - no real entity beans here.

thanks

Tim


From: Marc E Date:   Monday, May 22, 2006
I can tell you that pooling with POJO is pretty easy. I have been using c3p0
pool for over a year now with much success. No need for jndi or
anything...just straight up driver/url stuff that you pass when you
configure the pool and it handles the rest.
Hi,
I've entity beans which act purely in a stateless service fashion -
essentially executing SQL and performing business logic and then
returning business objects.
I establish the JDBC connection manually and all the beans *seem* to be
using the same connection since it is accessed statically. I dont know
whether that creates a problem if the beans are all their own threads..
anyway.
I am all for some pooling - I vaguely remember someone suggesting that
standalone JDBC can easily pool for you - without a container or
anything else.
If so I am not sure what I'd get from an EJB datasource beyond some
transaction management possibilities down the road if I cant architect
around it.
So my question is a) can I pool with POJO and b) is it far better to
have the container do it?
Note I generate and execute my own SQL - no real entity beans here.
thanks
Tim


>



Next Message: [tomcat] Get the HTTP port (with a mbean ?)


Blogs related to pooling the JDBC connection

Re: Error in running JDBC Request
Make sure you create the pool using the same name as you use for the JDBC sampler. ... JDBCSampler: Error in JDBC sampling java.sql.SQLException: No pool ... this driver through JDBC API(java.sql.Connection) in standalone Java program. ...

RE: Error in running JDBC Request
Hi, The Java standalone program connects through standalone connection, not pooled one. And in JMeter, isn't there a way to run JDBC request through standalone connection? If not, then I have to create a connection pool? ...

java.net.SocketException Broken Pipe Exception
My assumption was that the pool was not doing its job and MySQL was killing the ... at com.mysql.jdbc.Connection.execSQL(Connection.java(Compiled Code)) ... time I used C3P0 for my connection pool I decided to Google the problem first. ...

Environment Specific Information (updated)
getString() in the oracle jdbc driver. However, it threw up a new problem, ... It is also appropriate when using WebSphere connection pooling, EJBs, ... We must rely on Java to escape the value before passing it in to SqlMaps by using ...

Re: Error in running JDBC Request
You need to create the pool using the JDBC Connection config, and use the same pool name in the JDBC Sampler. ... JDBCSampler: Error in JDBC sampling java.sql.SQLException: No pool created > > at org.apache.jmeter.protocol.jdbc.sampler. ...

My First Hibernate Enabled Flex Application
However, it is assumed that you have working knowledge of Java, MySQL and J2EE based web application creation and ... So, we'll need a java class that will expose these data elements. ... JDBC connection pool (use the built-in) --> ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional