Cesar --

You may want to take a look at the 'profiles' capability within the metadata manager.  
In your case, you'd set up a separate profile for each company.  The only difference 
between the profiles would be the schema name assigned to each class descriptor.

At start up, your repository.xml would contain a single set of class-descriptors with 
no schema name set.  Then, you'd do the following for each company:
1) Get the original DescriptorRepository via the copyOfGlobalRepository.
2) Loop through all class descriptors and set the schema name accordingly.
3) Add the profile via the MetadataManager::addProfile method.  Since your profiles 
are company specific, you can use the name of the company as the 'key' for the profile.

Then, after you acquire a PersistenceBroker, you'd tell the MetadataManager to load 
the profile that is specific to the 'current' company.

HTH

Ron Gallagher
Atlanta, GA
[EMAIL PROTECTED]


> 
> From: "cesar.leite" <[EMAIL PROTECTED]>
> Date: 2003/09/21 Sun AM 09:11:56 EDT
> To: [EMAIL PROTECTED]
> Subject: Re: SCHEMA
> 
> Hi Wayne
> 
> I read in emails this solution but my problem is that my
> application work "N" companies and for each company I have a
> schema different i'am working with DB2 and this solution is
> not best in my the case.
> 
> Is There another solution with ojb?
> 
> [ ]´s
> Cesar
> 
> > When a PersistenceBrokerFactory creates a PersistenceBroker
> instance, it
> > can specify a different jcdalias.  That alias can work again
> st the same
> > repository.xml but a different url (accessing a different da
> tabase).  In
> > order for this to work properly, the OJB.properties should s
> pecify
> > ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCachePerB
> rokerImpl
> >
> > so that seperate caches are maintained for the separate
> > PersistenceBroker instances.
> >
> > Wayne
> >
> >
> > cesar.leite wrote:
> >
> > >Hi
> > >I would like to know if with ojb i can change my schema whe
> n
> > >i'm executing my program?
> > >
> > >Example: I can use the SCHEMA1.PRODUCT and later I can use
> > >SCHEMA2.PRODUCT to have access the same table product.
> > >
> > >thanks.
> > >Cesar
> > >
> > >
> > >---
> > >Acabe com aquelas janelinhas que pulam na sua tela.
> > >AntiPop-up UOL - É grátis!
> > >http://antipopup.uol.com.br
> > >
> > >
> > >-----------------------------------------------------------
> ----------
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: ojb-user-
> [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > ------------------------------------------------------------
> ---------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> ---
> Acabe com aquelas janelinhas que pulam na sua tela.
> AntiPop-up UOL - É grátis!
> http://antipopup.uol.com.br
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to