You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Ilan Azbel <ia...@mdio.net> on 2004/05/18 15:58:16 UTC

Multiple DB connections

Hello,

I have a requirement that my web app connects to 3 different databases, all
residing on different servers. How can this be achieved?

Ilan


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: different templates for different pages

Posted by Jürgen Hoffmann <jh...@byteaction.de>.
Hi Ilan,

yes Turbine is by default skinnable. Please have a Look at the UIManager
Class.

Kind regards

Jürgen Hoffmann

Am Fr, den 04.06.2004 schrieb Ilan Azbel um 16:42:

> Hello,
> 
> Is it possible to make different pages use different templates? How?
> 
> Ilan
> 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 
> !EXCUBATOR:40c08a51156311747816471!
> 

different templates for different pages

Posted by Ilan Azbel <ia...@mdio.net>.
Hello,

Is it possible to make different pages use different templates? How?

Ilan



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Flushing cache of class files

Posted by David Demner <tu...@demner.com>.
Ilan,

Sounds like it shouldn't be possible...  Maybe it's your browser's cache of
the processed .vm file?

David

-----Original Message-----
From: Ilan Azbel [mailto:iazbel@mdio.net] 
Sent: Monday May 31, 2004 6:42 AM
To: Turbine Users List
Subject: Flushing cache of class files


Hello,

I am using Tomcat in conjunction with velocity and turbine. Is it possible
to get Tomcat to flush its cache of class files?

For example, I create a velocity file test.vm, with a corresponding
test.java. I compile the java file, call the vm file from my browser and all
is well.

Now, I delete my compiled .class file, I restart the tomcat server, then
call the test.vm from my browser and it still somehow processes the stuff as
if it finds a .class file?!?!?!

How is this possible?

Ilan

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.691 / Virus Database: 452 - Release Date: 2004/05/26


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Non-authenticated web site with velocity

Posted by Jürgen Hoffmann <jh...@byteaction.de>.
Hi,

what does the error say? What is printed in the logs?

kind regards

Jürgen Hoffmann

Am Fr, den 04.06.2004 schrieb Ilan Azbel um 17:27:

> VelocityScreen. This is why I don't understand why I get the error!!!
> 
> 
> -----Original Message-----
> From: Jürgen Hoffmann [mailto:jh@byteaction.de]
> Sent: 04 June 2004 05:12
> To: Turbine Users List
> Subject: Re: Non-authenticated web site with velocity
> 
> 
> Hi Ilan,
> 
> are you extending VelocityScreen, or VelocitySecureScreen?
> 
> Kind regards
> 
> Jürgen Hoffmann
> 
> Am Fr, den 04.06.2004 schrieb Ilan Azbel um 16:42:
> 
> > Hello,
> >
> > I have a bit of a weird authentication requirement with regards to
> > authentication. I am not sure how to implement it:
> >
> > If the user types in the web address (for example: http://www.mysite.com),
> I
> > would like him to be redirected to home.vm - which is a non-authenticated
> > page.
> >
> > I have created an index.jsp in the ROOT. And the redirect works (I know
> this
> > because I see the new URL in the address bar of my browser), but I always
> > get an error screen. My web page (home.vm) contains one line:
> > <h1>hello</h1>. What can be causing this error?
> >
> > Thanks
> > Ilan
> >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
> >
> > 
> >
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 
> !EXCUBATOR:40c094f4261821241713488!
> 

RE: Non-authenticated web site with velocity

Posted by Ilan Azbel <ia...@mdio.net>.
Thanks for the help. I was calling it incorrectly. It works now.

Ilan


-----Original Message-----
From: David Demner [mailto:turbine@demner.com]
Sent: 04 June 2004 05:43
To: 'Turbine Users List'
Subject: RE: Non-authenticated web site with velocity


Hi Ilan,

Are you sure it's an authentication error? Not an error in the config of
your webapp (ie: not able to run servlets)? Or the home.vm being in the
wrong spot?

One of the quirks of turbine is you don't really get a 404 error, just a
'System Error:' page if the page isn't found.  Which is quite misleading
sometimes.

Good luck,

David

-----Original Message-----
From: Ilan Azbel [mailto:iazbel@mdio.net]
Sent: Friday June 4, 2004 8:27 AM
To: Turbine Users List; jh@byteaction.de
Subject: RE: Non-authenticated web site with velocity


VelocityScreen. This is why I don't understand why I get the error!!!


-----Original Message-----
From: Jürgen Hoffmann [mailto:jh@byteaction.de]
Sent: 04 June 2004 05:12
To: Turbine Users List
Subject: Re: Non-authenticated web site with velocity


Hi Ilan,

are you extending VelocityScreen, or VelocitySecureScreen?

Kind regards

Jürgen Hoffmann

Am Fr, den 04.06.2004 schrieb Ilan Azbel um 16:42:

> Hello,
>
> I have a bit of a weird authentication requirement with regards to
> authentication. I am not sure how to implement it:
>
> If the user types in the web address (for example: http://www.mysite.com),
I
> would like him to be redirected to home.vm - which is a non-authenticated
> page.
>
> I have created an index.jsp in the ROOT. And the redirect works (I know
this
> because I see the new URL in the address bar of my browser), but I always
> get an error screen. My web page (home.vm) contains one line:
> <h1>hello</h1>. What can be causing this error?
>
> Thanks
> Ilan
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> !EXCUBATOR:40c08a57156471179018833!
>

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Non-authenticated web site with velocity

Posted by David Demner <tu...@demner.com>.
Hi Ilan,

Are you sure it's an authentication error? Not an error in the config of
your webapp (ie: not able to run servlets)? Or the home.vm being in the
wrong spot?

One of the quirks of turbine is you don't really get a 404 error, just a
'System Error:' page if the page isn't found.  Which is quite misleading
sometimes.

Good luck,

David

-----Original Message-----
From: Ilan Azbel [mailto:iazbel@mdio.net] 
Sent: Friday June 4, 2004 8:27 AM
To: Turbine Users List; jh@byteaction.de
Subject: RE: Non-authenticated web site with velocity


VelocityScreen. This is why I don't understand why I get the error!!!


-----Original Message-----
From: Jürgen Hoffmann [mailto:jh@byteaction.de]
Sent: 04 June 2004 05:12
To: Turbine Users List
Subject: Re: Non-authenticated web site with velocity


Hi Ilan,

are you extending VelocityScreen, or VelocitySecureScreen?

Kind regards

Jürgen Hoffmann

Am Fr, den 04.06.2004 schrieb Ilan Azbel um 16:42:

> Hello,
>
> I have a bit of a weird authentication requirement with regards to
> authentication. I am not sure how to implement it:
>
> If the user types in the web address (for example: http://www.mysite.com),
I
> would like him to be redirected to home.vm - which is a non-authenticated
> page.
>
> I have created an index.jsp in the ROOT. And the redirect works (I know
this
> because I see the new URL in the address bar of my browser), but I always
> get an error screen. My web page (home.vm) contains one line:
> <h1>hello</h1>. What can be causing this error?
>
> Thanks
> Ilan
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> !EXCUBATOR:40c08a57156471179018833!
>

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Non-authenticated web site with velocity

Posted by Ilan Azbel <ia...@mdio.net>.
VelocityScreen. This is why I don't understand why I get the error!!!


-----Original Message-----
From: Jürgen Hoffmann [mailto:jh@byteaction.de]
Sent: 04 June 2004 05:12
To: Turbine Users List
Subject: Re: Non-authenticated web site with velocity


Hi Ilan,

are you extending VelocityScreen, or VelocitySecureScreen?

Kind regards

Jürgen Hoffmann

Am Fr, den 04.06.2004 schrieb Ilan Azbel um 16:42:

> Hello,
>
> I have a bit of a weird authentication requirement with regards to
> authentication. I am not sure how to implement it:
>
> If the user types in the web address (for example: http://www.mysite.com),
I
> would like him to be redirected to home.vm - which is a non-authenticated
> page.
>
> I have created an index.jsp in the ROOT. And the redirect works (I know
this
> because I see the new URL in the address bar of my browser), but I always
> get an error screen. My web page (home.vm) contains one line:
> <h1>hello</h1>. What can be causing this error?
>
> Thanks
> Ilan
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> !EXCUBATOR:40c08a57156471179018833!
>

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Non-authenticated web site with velocity

Posted by Jürgen Hoffmann <jh...@byteaction.de>.
Hi Ilan,

are you extending VelocityScreen, or VelocitySecureScreen?

Kind regards

Jürgen Hoffmann

Am Fr, den 04.06.2004 schrieb Ilan Azbel um 16:42:

> Hello,
> 
> I have a bit of a weird authentication requirement with regards to
> authentication. I am not sure how to implement it:
> 
> If the user types in the web address (for example: http://www.mysite.com), I
> would like him to be redirected to home.vm - which is a non-authenticated
> page.
> 
> I have created an index.jsp in the ROOT. And the redirect works (I know this
> because I see the new URL in the address bar of my browser), but I always
> get an error screen. My web page (home.vm) contains one line:
> <h1>hello</h1>. What can be causing this error?
> 
> Thanks
> Ilan
> 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 
> !EXCUBATOR:40c08a57156471179018833!
> 

Non-authenticated web site with velocity

Posted by Ilan Azbel <ia...@mdio.net>.
Hello,

I have a bit of a weird authentication requirement with regards to
authentication. I am not sure how to implement it:

If the user types in the web address (for example: http://www.mysite.com), I
would like him to be redirected to home.vm - which is a non-authenticated
page.

I have created an index.jsp in the ROOT. And the redirect works (I know this
because I see the new URL in the address bar of my browser), but I always
get an error screen. My web page (home.vm) contains one line:
<h1>hello</h1>. What can be causing this error?

Thanks
Ilan



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.698 / Virus Database: 455 - Release Date: 2004/06/02


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Flushing cache of class files

Posted by Ilan Azbel <ia...@mdio.net>.
Hello,

I am using Tomcat in conjunction with velocity and turbine. Is it possible
to get Tomcat to flush its cache of class files?

For example, I create a velocity file test.vm, with a corresponding
test.java. I compile the java file, call the vm file from my browser and all
is well.

Now, I delete my compiled .class file, I restart the tomcat server, then
call the test.vm from my browser and it still somehow processes the stuff as
if it finds a .class file?!?!?!

How is this possible?

Ilan

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.691 / Virus Database: 452 - Release Date: 2004/05/26


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Multiple DB connections

Posted by David Demner <tu...@demner.com>.
Hi Ilan,

I'm not sure (I've never done it) but theoretically it's yes to all 3.

- You would create the XML file for each of your databases (the XML root
being <database name="newappx">).
- Then edit your build-torque.xml to call each of the newappx-schema.xml
files (by changing the 'sql', 'om', and 'insert-sql' [and maybe other?]
targets).  You'll can either hardcode the database & server names in your
build-torque.xml or create new attributes in the build.properties.
- Then run 'ant project-om', 'ant schema-sql', and 'ant insert-sql'.  This
should create your object model using the appropriate database, the SQL
files that will be used to generate your database, and then insert them into
the appropriate db.

Theoretically that should be it ;)

Good luck,

David

-----Original Message-----
From: Ilan Azbel [mailto:iazbel@mdio.net] 
Sent: Friday May 21, 2004 7:54 AM
To: Turbine Users List
Subject: RE: Multiple DB connections


ah, right, got it. thanks. One more question though:

Would it be possible to get torque to somehow create an object model for
more than one database by somehow configuring the appropriate schema file?

If I define multiple schema files it seems to generate all the schema files
in one database only. How can I tell it to create different schemas inside
different databases?

Also, if the above is possible, would it be necessary to explicitly tell
torque which database to use when making use of the object model?

Ilan





> -----Original Message-----
> From: David Demner [mailto:turbine@demner.com]
> Sent: 19 May 2004 04:36
> To: 'Turbine Users List'
> Subject: RE: Multiple DB connections
>
>
> Sorry for not being clearer.  Then all you would do is in your java is:
>
> java.sql.Connection connNewapp = Torque.getConnection("newapp");
> (or connNewapp = Torque.getConnection() since newapp is the default
> connection)
> java.sql.Connection connNewapp2 = Torque.getConnection("newapp2");
> java.sql.Connection connNewapp3 = Torque.getConnection("newapp3");
>
> This will get a standard java.sql.Connection to the databases
> configured in
> your Torque.properties (for your one application) even though they are
> pointing to 3 different databases.
>
> David
>
> -----Original Message-----
> From: Ilan Azbel [mailto:iazbel@mdio.net]
> Sent: Wednesday May 19, 2004 1:26 AM
> To: Turbine Users List
> Subject: RE: Multiple DB connections
>
>
> I see that you have configured 3 different application?!?! Can all three
> connections be used from one application?
>
> How would I get ant to generate the class files necessary for
> accessing the
> three different database from one application?
>
>
>
> > -----Original Message-----
> > From: David Demner [mailto:turbine@demner.com]
> > Sent: 18 May 2004 05:37
> > To: 'Turbine Users List'
> > Subject: RE: Multiple DB connections
> >
> >
> > How are you connecting to the databases?  For the default from
> the tdk it
> > would be (in Torque.properties):
> >
> > torque.database.default=newapp
> > torque.database.newapp.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp.factory=org.apache.torque.dsfactory.Torque
> > DataSource
> > Factory
> > torque.dsfactory.newapp.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp.connection.url = jdbc:mysql://host1/newapp
> > torque.dsfactory.newapp.connection.user = root1
> > torque.dsfactory.newapp.connection.password = root1
> >
> > torque.database.newapp2=newapp2
> > torque.database.newapp.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp2.factory=org.apache.torque.dsfactory.Torqu
> > eDataSourc
> > eFactory
> > torque.dsfactory.newapp2.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp2.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp2.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp2.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp2.connection.url = jdbc:mysql://host2/newapp
> > torque.dsfactory.newapp2.connection.user = root2
> > torque.dsfactory.newapp2.connection.password = root2
> >
> > torque.database.newapp3=newapp3
> > torque.database.newapp3.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp3.factory=org.apache.torque.dsfactory.Torqu
> > eDataSourc
> > eFactory
> > torque.dsfactory.newapp3.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp3.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp3.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp3.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp3.connection.url = jdbc:mysql://host3/newapp
> > torque.dsfactory.newapp3.connection.user = root3
> > torque.dsfactory.newapp3.connection.password = root3
> >
> >
> > Of course this changes depending on your choice of connection method.
> >
> > Good luck,
> >
> > David
> >
> > -----Original Message-----
> > From: Ilan Azbel [mailto:iazbel@mdio.net]
> > Sent: Tuesday May 18, 2004 6:58 AM
> > To: Turbine Users List
> > Subject: Multiple DB connections
> >
> >
> > Hello,
> >
> > I have a requirement that my web app connects to 3 different
> > databases, all
> > residing on different servers. How can this be achieved?
> >
> > Ilan
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Multiple DB connections

Posted by Ilan Azbel <ia...@mdio.net>.
ah, right, got it. thanks. One more question though:

Would it be possible to get torque to somehow create an object model for
more than one database by somehow configuring the appropriate schema file?

If I define multiple schema files it seems to generate all the schema files
in one database only. How can I tell it to create different schemas inside
different databases?

Also, if the above is possible, would it be necessary to explicitly tell
torque which database to use when making use of the object model?

Ilan





> -----Original Message-----
> From: David Demner [mailto:turbine@demner.com]
> Sent: 19 May 2004 04:36
> To: 'Turbine Users List'
> Subject: RE: Multiple DB connections
>
>
> Sorry for not being clearer.  Then all you would do is in your java is:
>
> java.sql.Connection connNewapp = Torque.getConnection("newapp");
> (or connNewapp = Torque.getConnection() since newapp is the default
> connection)
> java.sql.Connection connNewapp2 = Torque.getConnection("newapp2");
> java.sql.Connection connNewapp3 = Torque.getConnection("newapp3");
>
> This will get a standard java.sql.Connection to the databases
> configured in
> your Torque.properties (for your one application) even though they are
> pointing to 3 different databases.
>
> David
>
> -----Original Message-----
> From: Ilan Azbel [mailto:iazbel@mdio.net]
> Sent: Wednesday May 19, 2004 1:26 AM
> To: Turbine Users List
> Subject: RE: Multiple DB connections
>
>
> I see that you have configured 3 different application?!?! Can all three
> connections be used from one application?
>
> How would I get ant to generate the class files necessary for
> accessing the
> three different database from one application?
>
>
>
> > -----Original Message-----
> > From: David Demner [mailto:turbine@demner.com]
> > Sent: 18 May 2004 05:37
> > To: 'Turbine Users List'
> > Subject: RE: Multiple DB connections
> >
> >
> > How are you connecting to the databases?  For the default from
> the tdk it
> > would be (in Torque.properties):
> >
> > torque.database.default=newapp
> > torque.database.newapp.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp.factory=org.apache.torque.dsfactory.Torque
> > DataSource
> > Factory
> > torque.dsfactory.newapp.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp.connection.url = jdbc:mysql://host1/newapp
> > torque.dsfactory.newapp.connection.user = root1
> > torque.dsfactory.newapp.connection.password = root1
> >
> > torque.database.newapp2=newapp2
> > torque.database.newapp.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp2.factory=org.apache.torque.dsfactory.Torqu
> > eDataSourc
> > eFactory
> > torque.dsfactory.newapp2.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp2.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp2.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp2.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp2.connection.url = jdbc:mysql://host2/newapp
> > torque.dsfactory.newapp2.connection.user = root2
> > torque.dsfactory.newapp2.connection.password = root2
> >
> > torque.database.newapp3=newapp3
> > torque.database.newapp3.adapter=mysql
> > ## Using torque's old pool
> > torque.dsfactory.newapp3.factory=org.apache.torque.dsfactory.Torqu
> > eDataSourc
> > eFactory
> > torque.dsfactory.newapp3.pool.defaultMaxConnections=10
> > torque.dsfactory.newapp3.pool.maxExpiryTime=3600
> > torque.dsfactory.newapp3.pool.connectionWaitTimeout=10
> > torque.dsfactory.newapp3.connection.driver = org.gjt.mm.mysql.Driver
> > torque.dsfactory.newapp3.connection.url = jdbc:mysql://host3/newapp
> > torque.dsfactory.newapp3.connection.user = root3
> > torque.dsfactory.newapp3.connection.password = root3
> >
> >
> > Of course this changes depending on your choice of connection method.
> >
> > Good luck,
> >
> > David
> >
> > -----Original Message-----
> > From: Ilan Azbel [mailto:iazbel@mdio.net]
> > Sent: Tuesday May 18, 2004 6:58 AM
> > To: Turbine Users List
> > Subject: Multiple DB connections
> >
> >
> > Hello,
> >
> > I have a requirement that my web app connects to 3 different
> > databases, all
> > residing on different servers. How can this be achieved?
> >
> > Ilan
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Multiple DB connections

Posted by David Demner <tu...@demner.com>.
Sorry for not being clearer.  Then all you would do is in your java is:

java.sql.Connection connNewapp = Torque.getConnection("newapp");
(or connNewapp = Torque.getConnection() since newapp is the default
connection)
java.sql.Connection connNewapp2 = Torque.getConnection("newapp2");
java.sql.Connection connNewapp3 = Torque.getConnection("newapp3");

This will get a standard java.sql.Connection to the databases configured in
your Torque.properties (for your one application) even though they are
pointing to 3 different databases.

David

-----Original Message-----
From: Ilan Azbel [mailto:iazbel@mdio.net] 
Sent: Wednesday May 19, 2004 1:26 AM
To: Turbine Users List
Subject: RE: Multiple DB connections


I see that you have configured 3 different application?!?! Can all three
connections be used from one application?

How would I get ant to generate the class files necessary for accessing the
three different database from one application?



> -----Original Message-----
> From: David Demner [mailto:turbine@demner.com]
> Sent: 18 May 2004 05:37
> To: 'Turbine Users List'
> Subject: RE: Multiple DB connections
>
>
> How are you connecting to the databases?  For the default from the tdk it
> would be (in Torque.properties):
>
> torque.database.default=newapp
> torque.database.newapp.adapter=mysql
> ## Using torque's old pool
> torque.dsfactory.newapp.factory=org.apache.torque.dsfactory.Torque
> DataSource
> Factory
> torque.dsfactory.newapp.pool.defaultMaxConnections=10
> torque.dsfactory.newapp.pool.maxExpiryTime=3600
> torque.dsfactory.newapp.pool.connectionWaitTimeout=10
> torque.dsfactory.newapp.connection.driver = org.gjt.mm.mysql.Driver
> torque.dsfactory.newapp.connection.url = jdbc:mysql://host1/newapp
> torque.dsfactory.newapp.connection.user = root1
> torque.dsfactory.newapp.connection.password = root1
>
> torque.database.newapp2=newapp2
> torque.database.newapp.adapter=mysql
> ## Using torque's old pool
> torque.dsfactory.newapp2.factory=org.apache.torque.dsfactory.Torqu
> eDataSourc
> eFactory
> torque.dsfactory.newapp2.pool.defaultMaxConnections=10
> torque.dsfactory.newapp2.pool.maxExpiryTime=3600
> torque.dsfactory.newapp2.pool.connectionWaitTimeout=10
> torque.dsfactory.newapp2.connection.driver = org.gjt.mm.mysql.Driver
> torque.dsfactory.newapp2.connection.url = jdbc:mysql://host2/newapp
> torque.dsfactory.newapp2.connection.user = root2
> torque.dsfactory.newapp2.connection.password = root2
>
> torque.database.newapp3=newapp3
> torque.database.newapp3.adapter=mysql
> ## Using torque's old pool
> torque.dsfactory.newapp3.factory=org.apache.torque.dsfactory.Torqu
> eDataSourc
> eFactory
> torque.dsfactory.newapp3.pool.defaultMaxConnections=10
> torque.dsfactory.newapp3.pool.maxExpiryTime=3600
> torque.dsfactory.newapp3.pool.connectionWaitTimeout=10
> torque.dsfactory.newapp3.connection.driver = org.gjt.mm.mysql.Driver
> torque.dsfactory.newapp3.connection.url = jdbc:mysql://host3/newapp
> torque.dsfactory.newapp3.connection.user = root3
> torque.dsfactory.newapp3.connection.password = root3
>
>
> Of course this changes depending on your choice of connection method.
>
> Good luck,
>
> David
>
> -----Original Message-----
> From: Ilan Azbel [mailto:iazbel@mdio.net]
> Sent: Tuesday May 18, 2004 6:58 AM
> To: Turbine Users List
> Subject: Multiple DB connections
>
>
> Hello,
>
> I have a requirement that my web app connects to 3 different
> databases, all
> residing on different servers. How can this be achieved?
>
> Ilan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Multiple DB connections

Posted by Ilan Azbel <ia...@mdio.net>.
I see that you have configured 3 different application?!?! Can all three
connections be used from one application?

How would I get ant to generate the class files necessary for accessing the
three different database from one application?



> -----Original Message-----
> From: David Demner [mailto:turbine@demner.com]
> Sent: 18 May 2004 05:37
> To: 'Turbine Users List'
> Subject: RE: Multiple DB connections
>
>
> How are you connecting to the databases?  For the default from the tdk it
> would be (in Torque.properties):
>
> torque.database.default=newapp
> torque.database.newapp.adapter=mysql
> ## Using torque's old pool
> torque.dsfactory.newapp.factory=org.apache.torque.dsfactory.Torque
> DataSource
> Factory
> torque.dsfactory.newapp.pool.defaultMaxConnections=10
> torque.dsfactory.newapp.pool.maxExpiryTime=3600
> torque.dsfactory.newapp.pool.connectionWaitTimeout=10
> torque.dsfactory.newapp.connection.driver = org.gjt.mm.mysql.Driver
> torque.dsfactory.newapp.connection.url = jdbc:mysql://host1/newapp
> torque.dsfactory.newapp.connection.user = root1
> torque.dsfactory.newapp.connection.password = root1
>
> torque.database.newapp2=newapp2
> torque.database.newapp.adapter=mysql
> ## Using torque's old pool
> torque.dsfactory.newapp2.factory=org.apache.torque.dsfactory.Torqu
> eDataSourc
> eFactory
> torque.dsfactory.newapp2.pool.defaultMaxConnections=10
> torque.dsfactory.newapp2.pool.maxExpiryTime=3600
> torque.dsfactory.newapp2.pool.connectionWaitTimeout=10
> torque.dsfactory.newapp2.connection.driver = org.gjt.mm.mysql.Driver
> torque.dsfactory.newapp2.connection.url = jdbc:mysql://host2/newapp
> torque.dsfactory.newapp2.connection.user = root2
> torque.dsfactory.newapp2.connection.password = root2
>
> torque.database.newapp3=newapp3
> torque.database.newapp3.adapter=mysql
> ## Using torque's old pool
> torque.dsfactory.newapp3.factory=org.apache.torque.dsfactory.Torqu
> eDataSourc
> eFactory
> torque.dsfactory.newapp3.pool.defaultMaxConnections=10
> torque.dsfactory.newapp3.pool.maxExpiryTime=3600
> torque.dsfactory.newapp3.pool.connectionWaitTimeout=10
> torque.dsfactory.newapp3.connection.driver = org.gjt.mm.mysql.Driver
> torque.dsfactory.newapp3.connection.url = jdbc:mysql://host3/newapp
> torque.dsfactory.newapp3.connection.user = root3
> torque.dsfactory.newapp3.connection.password = root3
>
>
> Of course this changes depending on your choice of connection method.
>
> Good luck,
>
> David
>
> -----Original Message-----
> From: Ilan Azbel [mailto:iazbel@mdio.net]
> Sent: Tuesday May 18, 2004 6:58 AM
> To: Turbine Users List
> Subject: Multiple DB connections
>
>
> Hello,
>
> I have a requirement that my web app connects to 3 different
> databases, all
> residing on different servers. How can this be achieved?
>
> Ilan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Multiple DB connections

Posted by David Demner <tu...@demner.com>.
How are you connecting to the databases?  For the default from the tdk it
would be (in Torque.properties):

torque.database.default=newapp
torque.database.newapp.adapter=mysql
## Using torque's old pool
torque.dsfactory.newapp.factory=org.apache.torque.dsfactory.TorqueDataSource
Factory
torque.dsfactory.newapp.pool.defaultMaxConnections=10
torque.dsfactory.newapp.pool.maxExpiryTime=3600
torque.dsfactory.newapp.pool.connectionWaitTimeout=10
torque.dsfactory.newapp.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.newapp.connection.url = jdbc:mysql://host1/newapp
torque.dsfactory.newapp.connection.user = root1
torque.dsfactory.newapp.connection.password = root1

torque.database.newapp2=newapp2
torque.database.newapp.adapter=mysql
## Using torque's old pool
torque.dsfactory.newapp2.factory=org.apache.torque.dsfactory.TorqueDataSourc
eFactory
torque.dsfactory.newapp2.pool.defaultMaxConnections=10
torque.dsfactory.newapp2.pool.maxExpiryTime=3600
torque.dsfactory.newapp2.pool.connectionWaitTimeout=10
torque.dsfactory.newapp2.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.newapp2.connection.url = jdbc:mysql://host2/newapp
torque.dsfactory.newapp2.connection.user = root2
torque.dsfactory.newapp2.connection.password = root2

torque.database.newapp3=newapp3
torque.database.newapp3.adapter=mysql
## Using torque's old pool
torque.dsfactory.newapp3.factory=org.apache.torque.dsfactory.TorqueDataSourc
eFactory
torque.dsfactory.newapp3.pool.defaultMaxConnections=10
torque.dsfactory.newapp3.pool.maxExpiryTime=3600
torque.dsfactory.newapp3.pool.connectionWaitTimeout=10
torque.dsfactory.newapp3.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.newapp3.connection.url = jdbc:mysql://host3/newapp
torque.dsfactory.newapp3.connection.user = root3
torque.dsfactory.newapp3.connection.password = root3


Of course this changes depending on your choice of connection method.

Good luck,

David

-----Original Message-----
From: Ilan Azbel [mailto:iazbel@mdio.net] 
Sent: Tuesday May 18, 2004 6:58 AM
To: Turbine Users List
Subject: Multiple DB connections


Hello,

I have a requirement that my web app connects to 3 different databases, all
residing on different servers. How can this be achieved?

Ilan


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org