db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rohwer, Jan" <Jan.Roh...@logicacmg.com>
Subject Problem with second database
Date Tue, 21 Jan 2003 14:53:26 GMT

Hi everybody !

First of all I like to say, that I like the easy way in which you can
use your DataObjects with Torque.

But I have a problem:
I'm using Jetspeed and since I don't want to move the default data, I
created
a second database in Torque.properties.
So far so good. I then want to query some DataObjects from this non-default
database.
I use the following code:

Connection con = Torque.getConnection("myDB");
List list = ObjPeer.doSelect(new Criteria(), con);

This works fine, and now I have a list of Objs. These are objects which also
have a foreign key 
relation to another table in the database. When I now try to access one of
these objects with
the supplied getter, I get a TorqueException. I figured out, that Torque
uses the default database
connection to try and load this object. This should definitely not happen,
since I loaded the
original object through my self-defined connection.

One possible solution is to use the doSelectJoin and set the database name
in the Criteria object,
but I don't want to load all associated objects at once.

Is there any other way to do this ?? Or is this actually a bug ?

Thanks in advance

Jan Rohwer


Jan Rohwer
LogicaCMG <http://www.logicacmg.com/de/>
Insurance - Financial Services
Osterbekstr. 90b
22083 Hamburg
Tel.  : +49 40 27071-391
EMail : Jan.Rohwer@LogicaCMG.com <mailto:Jan.Rohwer@logicacmg.com>


This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It
may contain proprietary material, confidential information and/or be subject to legal privilege.
 It should not be copied, disclosed to, retained or used by, any other party.  If you are
not an intended recipient then please promptly delete this e-mail and any attachment and all
copies and inform the sender.  Thank you.

Mime
View raw message