Leon Messerschmidt wrote:
> 
> Hi
> 
> I've been taking a look at the Castor service in Turbine, and I have some
> minor questions.
> 
> 1.  The getJDO() method currently is:
> 
>     public JDO getJDO ()
>     {
>         JDO jdo = new JDO (databasename);
>         jdo.setLogWriter (logger);
>         return jdo;
>     }
> 
> This means every time getJDO is called (it is called on every request for a
> connection) a new JDO object is created.  According to the Castor docs
> (version 0.8.6) any number of connections can be obtained from a single JDO
> object - with the benefit of pooling, etc.  Shouldn't there be only one JDO
> object for each Castor service instance or am I missing something?

You can use the getDatabase() method of the TurbineCastorService to
obtain a connection to the database. This is a wrapper to the
jdo.getDatabase () method. Now the Service make use of the castor
pooling.

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:[EMAIL PROTECTED]
CH-8166 Niederweningen                    Web:   http://www.pwr.ch


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to