Thread: mysql/posgresql pooling

mysql/posgresql pooling

From
"Nico"
Date:
Hi, I run a servlet that runs on a Resin 3.0.2-webserver with MySQL and
PostgreSQL database server.
Operating system is Red Hat Enterprise Linux ES release 3 (Taroon Update 4).
Resin uses its own pooling mechanism. I can make normal connections through
both MySQL and PostgreSQL. However, when I try to get a connection from a
pool, only MySQL connections are returned. How do I tell my servlet it needs
a PostgreSQL connection instead of MySQL?

Kind regards,
Nico.



Re: mysql/posgresql pooling

From
"Zachery Jensen"
Date:
"Resin uses its own pooling mechanism."

This would indicate that you need help from the Resin folks, not the
pgsql folks.

-Zac

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Nico
Sent: Tuesday, May 03, 2005 6:54 AM
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] mysql/posgresql pooling

Hi, I run a servlet that runs on a Resin 3.0.2-webserver with MySQL and
PostgreSQL database server.
Operating system is Red Hat Enterprise Linux ES release 3 (Taroon Update
4).
Resin uses its own pooling mechanism. I can make normal connections
through
both MySQL and PostgreSQL. However, when I try to get a connection from
a
pool, only MySQL connections are returned. How do I tell my servlet it
needs
a PostgreSQL connection instead of MySQL?

Kind regards,
Nico.



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Re: mysql/posgresql pooling

From
"Nico"
Date:
There is only support for those who are owners of a commercial Resin-server
or those who are going to buy it. As for my webhosting-provider, he is not
responding to my questions...
Nico.

""Zachery Jensen"" <zjensen@edustructures.com> schreef in bericht
news:7C1F799CD6F85F4693C5B51236BA899BC4842B@mail1.planetsoftware.com...
> "Resin uses its own pooling mechanism."
>
> This would indicate that you need help from the Resin folks, not the
> pgsql folks.
>
> -Zac
>
> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Nico
> Sent: Tuesday, May 03, 2005 6:54 AM
> To: pgsql-jdbc@postgresql.org
> Subject: [JDBC] mysql/posgresql pooling
>
> Hi, I run a servlet that runs on a Resin 3.0.2-webserver with MySQL and
> PostgreSQL database server.
> Operating system is Red Hat Enterprise Linux ES release 3 (Taroon Update
> 4).
> Resin uses its own pooling mechanism. I can make normal connections
> through
> both MySQL and PostgreSQL. However, when I try to get a connection from
> a
> pool, only MySQL connections are returned. How do I tell my servlet it
> needs
> a PostgreSQL connection instead of MySQL?
>
> Kind regards,
> Nico.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>



Re: mysql/posgresql pooling

From
"Zachery Jensen"
Date:
That's unfortunate.  I'm sure if anyone here knows anything they'd be
happy to help you privately, otherwise I wish you luck finding the
answer.

-Zac

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Nico
Sent: Tuesday, May 03, 2005 9:59 AM
To: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] mysql/posgresql pooling

There is only support for those who are owners of a commercial
Resin-server
or those who are going to buy it. As for my webhosting-provider, he is
not
responding to my questions...
Nico.

""Zachery Jensen"" <zjensen@edustructures.com> schreef in bericht
news:7C1F799CD6F85F4693C5B51236BA899BC4842B@mail1.planetsoftware.com...
> "Resin uses its own pooling mechanism."
>
> This would indicate that you need help from the Resin folks, not the
> pgsql folks.
>
> -Zac
>
> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Nico
> Sent: Tuesday, May 03, 2005 6:54 AM
> To: pgsql-jdbc@postgresql.org
> Subject: [JDBC] mysql/posgresql pooling
>
> Hi, I run a servlet that runs on a Resin 3.0.2-webserver with MySQL
and
> PostgreSQL database server.
> Operating system is Red Hat Enterprise Linux ES release 3 (Taroon
Update
> 4).
> Resin uses its own pooling mechanism. I can make normal connections
> through
> both MySQL and PostgreSQL. However, when I try to get a connection
from
> a
> pool, only MySQL connections are returned. How do I tell my servlet it
> needs
> a PostgreSQL connection instead of MySQL?
>
> Kind regards,
> Nico.
>
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Re: mysql/posgresql pooling

From
Markus Schaber
Date:
Hi, Nico,

Nico wrote:
> Hi, I run a servlet that runs on a Resin 3.0.2-webserver with MySQL and
> PostgreSQL database server.
> Operating system is Red Hat Enterprise Linux ES release 3 (Taroon Update 4).
> Resin uses its own pooling mechanism. I can make normal connections through
> both MySQL and PostgreSQL. However, when I try to get a connection from a
> pool, only MySQL connections are returned. How do I tell my servlet it needs
> a PostgreSQL connection instead of MySQL?

How do you communicate with the pool? I do not know anything about the
Resin interfaces, but in jboss, you use jndi to look up your datasources
by a datasource name, and have *-ds.xml files that define the
datasources (map name to driver class, host name, port, username and
other connection properties).

To get a PostgreSQL connection, you need do deploy the appropriate
definition in one of your *-ds.xml files, and then use this name when
looking up your datasource.

You do this along the lines of:

import java.sql.Connection;
import javax.naming.InitialContext;
import javax.sql.DataSource;

public class example {
  public static Connection getConnection(String name) throws Exception {
    InitialContext ic = new InitialContext();
    DataSource dataSource = (DataSource) ic.lookup(name);
    return dataSource.getConnection();
  }
}

HTH,
Markus

Re: mysql/posgresql pooling

From
John R Pierce
Date:
Nico wrote:
> Hi, I run a servlet that runs on a Resin 3.0.2-webserver with MySQL and
> PostgreSQL database server.
> Operating system is Red Hat Enterprise Linux ES release 3 (Taroon Update 4).
> Resin uses its own pooling mechanism. I can make normal connections through
> both MySQL and PostgreSQL. However, when I try to get a connection from a
> pool, only MySQL connections are returned. How do I tell my servlet it needs
> a PostgreSQL connection instead of MySQL?

I dunno anything about that stuff specifically, but any time you're pooling
resources, and you have different sorts of resources, it makes sense to have
different pools.  In this case, it would be one pool for each database, so you
query the specific pool holding the class of resource you want....