users@glassfish.java.net

Problem with Oracle DataSource

From: <glassfish_at_javadesktop.org>
Date: Wed, 18 Apr 2007 23:49:32 PDT

Method DataSource.getConnection(String username, String password) returns previously used connection regardless of username param.

I'm using Oracle 10gR2. So I created connection pool and jdbc resource for it.
So here is the test example:

DataSource dataSource = (DataSource)new InitialContext().lookup("jdbc/KE");
Connection con1 = dataSource.getConnection("ke", "ke");
System.out.println(con1.getMetaData().getUserName());
con1.close();
Connection con2 = dataSource.getConnection("m2000", "m2000"); // HERE IS THE PROBLEM!!!
System.out.println(con2.getMetaData().getUserName());
con2.close();

As the result I get such output:
KE
KE

So method dataSource.getConnection("m2000", "m2000") returns connection for user KE.

What might be the problem? May be it in the pool configuration?

Thank you.
[Message sent by forum member 'hazurek' (hazurek)]

http://forums.java.net/jive/thread.jspa?messageID=213085