Is it possible to change the value of dbalias at runtime?

I would like to prefix the value of dbalias defined in repository.xml with a value at 
runtime. This is because I am using HSQLDB in standalone mode, inside a web 
application, and I would like to define the name of the database inside the 
repository.xml, e.g. test-db, but I'd like to define the path of the database at 
runtime, e.g. C:\My Documents\My Webapp\test-db.

I tried using:

MetadataManager.getInstance().connectionRepository().getAllDescriptor()

to get a list of descriptor then find and return the default descriptor. Then, for 
example:

String path = "C:\My Documents\My Webapp\";
descriptor.setDbAlias(path + descriptor.getDbAlias());

However when I call:

PersistenceBrokerFactory.defaultPersitenceBroker()

DbAlias is still "test-db" rather than "C:\My Documents\My Webapp\test-db"

Do I have to somehow 'save' the new descriptor values before I can use them? Or can I 
only create a new descriptor dynamically and not merge dynamic descriptor attributes 
with static descriptor attributes?

Any help would be gratefully received.

Regards,

Joss Wright





--------------------
talk21 your FREE portable and private address on the net at http://www.talk21.com


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

Reply via email to