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 Ilkka Priha <ip...@surfeu.fi> on 2003/02/11 11:49:55 UTC
Repository descriptors, PBKey and OJB 0.9.9
Hi,
In 0.9.6, it was also possible to add new repository descriptors during
run-time to PersistenceBrokerFactory by specifying the descriptor file
pathname in PBKey instead of the new db alias. Is there a recommended
method to do it in 0.9.9? We've tried something with MetadataManager and
RepositoryPersistor, but without much luck.
-- Ilkka Priha
Re: Repository descriptors, PBKey and OJB 0.9.9
Posted by Ilkka Priha <ip...@surfeu.fi>.
Thanks Armin,
This works great! Now we can change our configuration during run-time in
a feasible manner without restrictions :-)
-- Ilkka
Armin Waibel wrote:
> Hi Ilkka,
>
> I checked in new version of the MetadataManager
> with some new service methods among other things
> your proposed read methods.
>
> HTH
> regards,
> Armin
>
> ----- Original Message -----
> From: "Ilkka Priha" <ip...@surfeu.fi>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Tuesday, February 11, 2003 2:42 PM
> Subject: Re: Repository descriptors, PBKey and OJB 0.9.9
>
>
>
>>Hi Armin,
>>
>>
>>>-- cut --
>>>
>>>Currently there are only methods to add
>>>ClassDescriptors, .... add runtime.
>>>I think to realize that functionality we need merge methods for
>>>DescriptorRepository and ConnectionRepository:
>>>
>>>MetadataManager.mergeDescriptorRepository(DescriptorRepository
>>>newRepository)
>>>
>>>Is this what you have intended?
>>>
>>>regards,
>>>Armin
>>
>>In principle, yes, but starting from the descriptor file. So should
>>something like this work and will it be supported in future releases:
>>
>>RepositoryPersistor rp = new RepositoryPersistor();
>>ConnectionRepository cr = rp.readConnectionRepository("mysql.xml");
>>DescriptorRepository dr = rp.readDescriptorRepository("mysql.xml");
>>
>>List list = cr.getAllDescriptor();
>>ConnectionRepository metacr =
>> MetadataManager.getInstance().connectionRepository();
>>for (Iterator i = list.iterator(); i.hasNext();)
>>{
>> metacr.addDescriptor((JdbcConnectionDescriptor) i.next());
>>}
>>
>>Map.Entry entry;
>>Map map = dr.getDescriptorTable();
>>DescriptorRepository metadr =
>> MetadataManager.getInstance().getRepository();
>>for (Iterator i = map.entrySet().iterator(); i.hasNext();)
>>{
>> entry = (Map.Entry) i.next();
>> metadr.put(
>> (String) entry.getKey(),
>> (ClassDescriptor) entry.getValue());
>>}
>>
>>It just doesn't seem to be flexible enough for us to define all
>>descriptors in a property file during startup of a web service system
>>supporting dynamically configurable applications, which are loaded and
>>unloaded without shutdown. I think that OJB has all the capability
>>needed for dynamic configuration, it's just difficult to figure out
>>correct classes and methods to apply to use this potential.
>>
>>Of course the merge methods would make things easier, but even the
>
> above
>
>>code would be fine if we just dare to use it in our application :-)
>>
>>Thanks,
>> Ilkka
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>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
>
> .
>
Re: Repository descriptors, PBKey and OJB 0.9.9
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Ilkka,
I checked in new version of the MetadataManager
with some new service methods among other things
your proposed read methods.
HTH
regards,
Armin
----- Original Message -----
From: "Ilkka Priha" <ip...@surfeu.fi>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, February 11, 2003 2:42 PM
Subject: Re: Repository descriptors, PBKey and OJB 0.9.9
> Hi Armin,
>
> > -- cut --
> >
> > Currently there are only methods to add
> > ClassDescriptors, .... add runtime.
> > I think to realize that functionality we need merge methods for
> > DescriptorRepository and ConnectionRepository:
> >
> > MetadataManager.mergeDescriptorRepository(DescriptorRepository
> > newRepository)
> >
> > Is this what you have intended?
> >
> > regards,
> > Armin
>
> In principle, yes, but starting from the descriptor file. So should
> something like this work and will it be supported in future releases:
>
> RepositoryPersistor rp = new RepositoryPersistor();
> ConnectionRepository cr = rp.readConnectionRepository("mysql.xml");
> DescriptorRepository dr = rp.readDescriptorRepository("mysql.xml");
>
> List list = cr.getAllDescriptor();
> ConnectionRepository metacr =
> MetadataManager.getInstance().connectionRepository();
> for (Iterator i = list.iterator(); i.hasNext();)
> {
> metacr.addDescriptor((JdbcConnectionDescriptor) i.next());
> }
>
> Map.Entry entry;
> Map map = dr.getDescriptorTable();
> DescriptorRepository metadr =
> MetadataManager.getInstance().getRepository();
> for (Iterator i = map.entrySet().iterator(); i.hasNext();)
> {
> entry = (Map.Entry) i.next();
> metadr.put(
> (String) entry.getKey(),
> (ClassDescriptor) entry.getValue());
> }
>
> It just doesn't seem to be flexible enough for us to define all
> descriptors in a property file during startup of a web service system
> supporting dynamically configurable applications, which are loaded and
> unloaded without shutdown. I think that OJB has all the capability
> needed for dynamic configuration, it's just difficult to figure out
> correct classes and methods to apply to use this potential.
>
> Of course the merge methods would make things easier, but even the
above
> code would be fine if we just dare to use it in our application :-)
>
> Thanks,
> Ilkka
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
Re: Repository descriptors, PBKey and OJB 0.9.9
Posted by Ilkka Priha <ip...@surfeu.fi>.
Hi Armin,
> -- cut --
>
> Currently there are only methods to add
> ClassDescriptors, .... add runtime.
> I think to realize that functionality we need merge methods for
> DescriptorRepository and ConnectionRepository:
>
> MetadataManager.mergeDescriptorRepository(DescriptorRepository
> newRepository)
>
> Is this what you have intended?
>
> regards,
> Armin
In principle, yes, but starting from the descriptor file. So should
something like this work and will it be supported in future releases:
RepositoryPersistor rp = new RepositoryPersistor();
ConnectionRepository cr = rp.readConnectionRepository("mysql.xml");
DescriptorRepository dr = rp.readDescriptorRepository("mysql.xml");
List list = cr.getAllDescriptor();
ConnectionRepository metacr =
MetadataManager.getInstance().connectionRepository();
for (Iterator i = list.iterator(); i.hasNext();)
{
metacr.addDescriptor((JdbcConnectionDescriptor) i.next());
}
Map.Entry entry;
Map map = dr.getDescriptorTable();
DescriptorRepository metadr =
MetadataManager.getInstance().getRepository();
for (Iterator i = map.entrySet().iterator(); i.hasNext();)
{
entry = (Map.Entry) i.next();
metadr.put(
(String) entry.getKey(),
(ClassDescriptor) entry.getValue());
}
It just doesn't seem to be flexible enough for us to define all
descriptors in a property file during startup of a web service system
supporting dynamically configurable applications, which are loaded and
unloaded without shutdown. I think that OJB has all the capability
needed for dynamic configuration, it's just difficult to figure out
correct classes and methods to apply to use this potential.
Of course the merge methods would make things easier, but even the above
code would be fine if we just dare to use it in our application :-)
Thanks,
Ilkka
Re: Repository descriptors, PBKey and OJB 0.9.9
Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Ilkka,
----- Original Message -----
From: "Ilkka Priha" <ip...@surfeu.fi>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Tuesday, February 11, 2003 11:49 AM
Subject: Repository descriptors, PBKey and OJB 0.9.9
> Hi,
>
> In 0.9.6, it was also possible to add new repository descriptors
during
> run-time to PersistenceBrokerFactory by specifying the descriptor file
> pathname in PBKey instead of the new db alias. Is there a recommended
> method to do it in 0.9.9? We've tried something with MetadataManager
and
> RepositoryPersistor, but without much luck.
Currently there are only methods to add
ClassDescriptors, .... add runtime.
I think to realize that functionality we need merge methods for
DescriptorRepository and ConnectionRepository:
MetadataManager.mergeDescriptorRepository(DescriptorRepository
newRepository)
Is this what you have intended?
regards,
Armin
>
> -- Ilkka Priha
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>