Isaac,

afaik, Database is an abstraction from the underlying JDBC connection, but in the end 
provides the same 
functionality plus some more. To address your concerns re: the use of Database 
instances in a multithreaded 
environment, here's how it works.

When working in a multithreaded environment (e.g. servlet container, application 
server, etc.) , please create a fresh 
Database instance via JDO.getDatabase() every time you need connectivity to a 
database. As you have configured 
Castor JDO to use JNDI to lookup database connections, it will as a result use the 
connection pool provided. In 
other words, the creation of a Database instance causes the instantiation of a fresh 
JDBC connection ... unless you 
are using a connection pool, where an existing connection will be reused.

I hope this answers your question.

Werner

 On Fri, 20 Jun 2003 14:31:38 -0400, [EMAIL PROTECTED] wrote:

>I have posted this question two times and have not yet  received an answer.
>I realize that perhaps I am ignorant as to the inner workings of Castor,
>but I would still appreciate a reply.
>
>I use a JNDI DataSource that implements a connection pool and I specify it
>like this in the database.xml:
>
><database name="cudd_nic_dev2" engine="sql-server">
>   <jndi name="java:comp/env/jdbc/esub2"/>
>   <mapping href="mapping.xml"/>
></database>
>
>Now my question is:  what does the org.exolab.castor.jdo.Database object
>represent?  In other words, if I have one instance of a database and two
>threads try to use it at the same time, will they be using the same
>physical database connection, or does database give each a connection from
>the pool?
>
>----------------------------------------------------------- 
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
>        unsubscribe castor-dev
>

-- 
Sincerely, the Minimalist

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to