You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Rick G <oj...@vidyah.com> on 2005/10/19 20:43:04 UTC

Proper OJB Startup Procedure?

Is there a preferred way to initialized OJB when starting a web app?
Currently, on my system, OJB doesn't really load up until the first DB
related call.  Was wondering if there were some call I could make to an OJB
Factory class or whatever, to initialize OJB, other than making a call that
would invoke a query.

On a side note, is there a way to pragmatically get the configured OJB Cache
setting? Other than reading it out of the repository_database.xml file of
course.
 	
Thanks for any tips/suggestions,

Rick Gavin



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Proper OJB Startup Procedure?

Posted by Armin Waibel <ar...@apache.org>.
Hi Rick,

Rick G wrote:
> Is there a preferred way to initialized OJB when starting a web app?
> Currently, on my system, OJB doesn't really load up until the first DB
> related call.  Was wondering if there were some call I could make to an OJB
> Factory class or whatever, to initialize OJB, other than making a call that
> would invoke a query.

OJB doesn't have a specific startup procedure, but you can lookup and 
close a PersistenceBroker instance to initialize OJB (think this will 
load metadata classes).


> 
> On a side note, is there a way to pragmatically get the configured OJB Cache
> setting? Other than reading it out of the repository_database.xml file of
> course.
>

To get the cache class defined in the jdbc-connection-descriptor you can 
  use the metadata classes, e.g. lookup a PB instance and do

Class cacheClass = 
broker.serviceConnectionManager().getConnectionDescriptor()
.getObjectCacheDescriptor().getObjectCache()

regards,
Armin

   	
> Thanks for any tips/suggestions,
> 
> Rick Gavin
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org