You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Jacopo Cappellato <ja...@libero.it> on 2001/12/07 11:22:18 UTC

Question about peers and db pools relations

Hi.

This is a newbie question... I think.
I don't understand what is the connection between peers and a specific db
(pool).
Example:
I have two different db (the Turbine db adapters are installed) and I have
configured in TR.properties two different db pools, poolA and poolB.
The two dbs contain the same table ITEM.
I want to create, through Torque, only the peer classes (not the SQL
scripts) for the ITEM table; so I edit the MyProject-schema.xml in which I
describe (for Torque) the table structure, and I run the proper ant task
Can I use the same generated ITEM peers to select records from the two
different pools?
What is the the pool used as default and how is it selected?
The peer classes are completely independent from the underlying db?

Thanks in advance,
Jacopo


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Question about peers and db pools relations

Posted by John McNally <jm...@collab.net>.
you can use the <database name="poolA" attribute to set the default pool
to "poolA".  If the database name is not given it defaults to
"default".  You can give an alternate pool for a Criteria with the 
criteria.setDbName("poolB") method.  Many of the BasePeer methods as
well as the object save methods can take a dbName argument as well.

john mcnally

Jacopo Cappellato wrote:
> 
> Hi.
> 
> This is a newbie question... I think.
> I don't understand what is the connection between peers and a specific db
> (pool).
> Example:
> I have two different db (the Turbine db adapters are installed) and I have
> configured in TR.properties two different db pools, poolA and poolB.
> The two dbs contain the same table ITEM.
> I want to create, through Torque, only the peer classes (not the SQL
> scripts) for the ITEM table; so I edit the MyProject-schema.xml in which I
> describe (for Torque) the table structure, and I run the proper ant task
> Can I use the same generated ITEM peers to select records from the two
> different pools?
> What is the the pool used as default and how is it selected?
> The peer classes are completely independent from the underlying db?
> 
> Thanks in advance,
> Jacopo
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>