I think I found the answer to my own question in the Commons DBCP
documentation:
http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/datas
ources/package-summary.html
Under the JNDI section, the last paragraph states:
The reference to the DataSource could be maintained,
> It sounds plausible to hold onto the DataSource once you had it.
I do, with PostgreSQL.
> And then there is an issue of synchronization?
Hmm... You got me thinking there :-)
I have always assumed that a DataSource reference retrieved from a JNDI
lookup is a singleton - IOW the connection
e profiler time. And then there is an issue of synchronization?
Doug
- Original Message -
From: "Alan Deikman" <[EMAIL PROTECTED]>
To:
Sent: Monday, January 17, 2005 1:42 PM
Subject: Question about JNDI resources
I'm just learning this stuff, but having good success s
You should be able to store a reference to the Datasource and that should be
all you need.
Its probably not done that way in the examples since static variables are
frowned upon. JNDI lookups are usually almost as faster a Hash lookup. So the
speed is fairly negligible.
-Tim
Alan Deikman wrote
I'm just learning this stuff, but having good success so far. In my
SQL-backed bean I use a JDBCResource as per the documentation:
protected static Connection getConnection() {
//System.out.println("User.getConnection Attempting to get
connection");
try {
Context initConte
I'm just learning this stuff, but having good success so far. In my
SQL-backed bean I use a JDBCResource as per the documentation:
protected static Connection getConnection() {
//System.out.println("User.getConnection Attempting to get
connection");
try {
Context initCo