db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Kincaid" <Jeremy.Kinc...@intermoco.com>
Subject How do I add a new database dynamically?
Date Tue, 27 Jan 2004 05:49:03 GMT
How do I add a new database to Torque after I have already initialized
it and whilst
still using it.  I do not whish to stop my server, update the property
files, then

I posted this question on the torque user list, and whilst I had one
response, it 
didn't solve my problem.  See listings with subject "How to dynamically
add new 
database to Torque".

I have looked through the source code to determine why I couldn't simply
update the
current Configuration and then re-initialize.  I observed that in the
TorqueInstance.initialize() method there is a statement preventing
[ if(isInit){return;} ]

I needed to accomplish my task quickly so I modified 3 methods in the
TorqueInstance.java file.  In particular:
 	1) added method addNewDatabase( Configuration conf ) - which you
call to add 
the new database after you have updated the current configuration file
With the new
 	2) modified initAdapters( Configuration conf ), 
	   initDataSourceFactories( Configuration conf ), 
	   and initManager( String name, String className ), 
which were modified to only add new items to Hashmaps if they don't
already exist, 
and to create Hashmaps only if they are null.

Can someone please enlighten me if there is a better way.

	Jeremy Kincaid

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

View raw message