Re: OracleConnectionPoolDataSource

2007-07-23 Thread Julio J. Suárez Salinero

Zdeněk Vráblík escribió:

Hi,


4. I use OracleConnectionPoolDataSource because with
javax.sql.DataSource it doesn't close correctly close connections from
pool and server got to hang up.


Have you got any exception?

It throwed Closed Statement, Exhausted Resultset and 
NullPointerException, but only when I do stress test. If I browse page 
with navigator it works correctly and throws no exceptions.


This is my resource:

Resource name=IC
auth=Container
type=oracle.jdbc.pool.OracleDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
user=IC
password=IC
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@192.168.100.119:1521:orcl

maxActive=20 maxIdle=10 maxwait=-1/ 
and this is my java code I use

try
{
// Look up the data source on the JNDI tree
DataSource ds = (DataSource) ctxt.lookup(java:/comp/env/ + poolName);


if (ds instanceof OracleDataSource)
{
log.debug(oracleDatasource found);
}

conn = ds.getConnection();

if (conn instanceof OracleConnection)
{
log.debug( OracleConnection - delegated );
}
}
catch ( Exception ex )
{
log.error( classId + Error getting Oracle Connection., ex );
throw ex;
}

With OracleDataSource instead of OracleConnectionPoolDataSource I can 
use user and password in the context, but when I run stress test 
with 10 users, I see it uses more connections than I put in context (It 
uses one per user and I put 8 in the context). It's seems not to respect 
the pool. And it throws no exceptions.

What jdbc driver do you use?

I use the driver from www.oracle.com that corresponds with my oracle 
version 
(http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html) 
Oracle9/i/ 9.2.0.1 JDBC Drivers for JDK 1.4.

And one question. Are you going to use any user transaction manager? :)
I use simpleJTA, but I have tested it only in developement...


I'm not using any user transaction manager. I think my page doesn't need it.

Regards,
Zdenek


Regards.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-23 Thread Propes, Barry L
Zdenek, I had gotten those errors, but like I said, it entailed me going back 
and properly closing each opened statement and connection.

-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 9:08 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


Zdeněk Vráblík escribió:
 Hi,

 4. I use OracleConnectionPoolDataSource because with
 javax.sql.DataSource it doesn't close correctly close connections from
 pool and server got to hang up.

 Have you got any exception?

It throwed Closed Statement, Exhausted Resultset and 
NullPointerException, but only when I do stress test. If I browse page 
with navigator it works correctly and throws no exceptions.

 This is my resource:

 Resource name=IC
 auth=Container
 type=oracle.jdbc.pool.OracleDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 user=IC
 password=IC
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@192.168.100.119:1521:orcl

 maxActive=20 maxIdle=10 maxwait=-1/ 
 and this is my java code I use
 try
 {
 // Look up the data source on the JNDI tree
 DataSource ds = (DataSource) ctxt.lookup(java:/comp/env/ + poolName);


 if (ds instanceof OracleDataSource)
 {
 log.debug(oracleDatasource found);
 }

 conn = ds.getConnection();

 if (conn instanceof OracleConnection)
 {
 log.debug( OracleConnection - delegated );
 }
 }
 catch ( Exception ex )
 {
 log.error( classId + Error getting Oracle Connection., ex );
 throw ex;
 }

With OracleDataSource instead of OracleConnectionPoolDataSource I can 
use user and password in the context, but when I run stress test 
with 10 users, I see it uses more connections than I put in context (It 
uses one per user and I put 8 in the context). It's seems not to respect 
the pool. And it throws no exceptions.
 What jdbc driver do you use?

I use the driver from www.oracle.com that corresponds with my oracle 
version 
(http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html)
 
Oracle9/i/ 9.2.0.1 JDBC Drivers for JDK 1.4.
 And one question. Are you going to use any user transaction manager? :)
 I use simpleJTA, but I have tested it only in developement...

I'm not using any user transaction manager. I think my page doesn't need it.
 Regards,
 Zdenek

Regards.
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Julio,

Julio J. Suárez Salinero wrote:
 Zdeněk Vráblík escribió:
 Hi,

 4. I use OracleConnectionPoolDataSource because with
 javax.sql.DataSource it doesn't close correctly close connections from
 pool and server got to hang up.

 Have you got any exception?

 It throwed Closed Statement, Exhausted Resultset and
 NullPointerException, but only when I do stress test. If I browse page
 with navigator it works correctly and throws no exceptions.

This suggests that the connections and statements are not being managed
properly. Are you sure you are using the pooled connections properly? If
you had told us what the exceptions you were getting earlier (always a
good idea to tell us HOW it's not working), I would have said that you
were leaking connections between requests.

Closed Statement usually means you're trying to read from a result set
that came from a statement that has been closed. Why are you trying to
read from a closed statement? I'm guessing your code doesn't do this:

PreparedStatement ps = conn.prepareStatement(...);
ResultSet rs = ps.executeQuery();

ps.close();
rs.next();

...because that would, of course, be stupid. The only explanation I can
think of is that somehow those connections and/or statements are being
accidentally shared by threads.

Let me ask another stupid question: if this was working before using
Tomcat's pooling, why are you killing yourself to use Oracle's pooled
connections when they don't appear to work properly?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpMiz9CaO5/Lv0PARAnj6AJ40JQr2/pHY1JeavYSdFUStYpQlSwCfbTRJ
YG2H7taNbtcp+DtTGIr/vcs=
=knx7
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-23 Thread Propes, Barry L
Like I told him, Chris, I experienced very similar scenarios with my connection 
pooling, and had to alter and/or rewrite the classes, but I did get them 
closing properly. 
Some took some significant tweaking, but I finally got it.

Zdenek, if you could post the original code, maybe we could narrow it down for 
you.

If you'd like to just send me a few files individually, go right ahead. I'll 
try to take a look at it and be of help.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 10:27 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Julio,

Julio J. Suárez Salinero wrote:
 Zdeněk Vráblík escribió:
 Hi,

 4. I use OracleConnectionPoolDataSource because with
 javax.sql.DataSource it doesn't close correctly close connections from
 pool and server got to hang up.

 Have you got any exception?

 It throwed Closed Statement, Exhausted Resultset and
 NullPointerException, but only when I do stress test. If I browse page
 with navigator it works correctly and throws no exceptions.

This suggests that the connections and statements are not being managed
properly. Are you sure you are using the pooled connections properly? If
you had told us what the exceptions you were getting earlier (always a
good idea to tell us HOW it's not working), I would have said that you
were leaking connections between requests.

Closed Statement usually means you're trying to read from a result set
that came from a statement that has been closed. Why are you trying to
read from a closed statement? I'm guessing your code doesn't do this:

PreparedStatement ps = conn.prepareStatement(...);
ResultSet rs = ps.executeQuery();

ps.close();
rs.next();

...because that would, of course, be stupid. The only explanation I can
think of is that somehow those connections and/or statements are being
accidentally shared by threads.

Let me ask another stupid question: if this was working before using
Tomcat's pooling, why are you killing yourself to use Oracle's pooled
connections when they don't appear to work properly?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpMiz9CaO5/Lv0PARAnj6AJ40JQr2/pHY1JeavYSdFUStYpQlSwCfbTRJ
YG2H7taNbtcp+DtTGIr/vcs=
=knx7
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-23 Thread Julio J. Suárez Salinero

Propes, Barry L escribió:
Like I told him, Chris, I experienced very similar scenarios with my connection pooling, and had to alter and/or rewrite the classes, but I did get them closing properly. 
Some took some significant tweaking, but I finally got it.


Zdenek, if you could post the original code, maybe we could narrow it down for 
you.

If you'd like to just send me a few files individually, go right ahead. I'll 
try to take a look at it and be of help.

  
Thank you very much, Barry L. I'm just testing a few changes in the 
code. When I have something I'll say you it.


Note: I'm not Zdenek. I'm Julio.

Regards.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 10:27 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Julio,

Julio J. Suárez Salinero wrote:
  

Zdeněk Vráblík escribió:


Hi,

  

4. I use OracleConnectionPoolDataSource because with
javax.sql.DataSource it doesn't close correctly close connections from
pool and server got to hang up.


Have you got any exception?

  

It throwed Closed Statement, Exhausted Resultset and
NullPointerException, but only when I do stress test. If I browse page
with navigator it works correctly and throws no exceptions.



This suggests that the connections and statements are not being managed
properly. Are you sure you are using the pooled connections properly? If
you had told us what the exceptions you were getting earlier (always a
good idea to tell us HOW it's not working), I would have said that you
were leaking connections between requests.

Closed Statement usually means you're trying to read from a result set
that came from a statement that has been closed. Why are you trying to
read from a closed statement? I'm guessing your code doesn't do this:

PreparedStatement ps = conn.prepareStatement(...);
ResultSet rs = ps.executeQuery();

ps.close();
rs.next();

...because that would, of course, be stupid. The only explanation I can
think of is that somehow those connections and/or statements are being
accidentally shared by threads.

Let me ask another stupid question: if this was working before using
Tomcat's pooling, why are you killing yourself to use Oracle's pooled
connections when they don't appear to work properly?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGpMiz9CaO5/Lv0PARAnj6AJ40JQr2/pHY1JeavYSdFUStYpQlSwCfbTRJ
YG2H7taNbtcp+DtTGIr/vcs=
=knx7
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  



--


---


*Julio Javier Suárez Salinero*

*Departamento de programación*

AVISO LEGAL: Este mensaje contiene información confidencial para ser 
leída exclusivamente por el destinatario. Su contenido no constituye un 
compromiso para el remitente salvo ratificación escrita por ambas 
partes. Queda prohibida la reproducción, publicación, divulgación, total 
o parcial del mensaje así como el uso no autorizados por el emisor. En 
caso de recibir el mensaje por error se ruega su comunicación al 
remitente lo antes posible.


LEGAL WARNING: This message contains confidential information for the 
exclusive use of the recipient. Its contents do not constitute a 
commitment by the sender except where provided for in a signed agreement 
between both parties. Any unauthorised disclosure, use or dissemination, 
either whole or partial, is prohibited. If you are not the intended 
recipient of the message, please notify.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-23 Thread Propes, Barry L
ok...is it you having problems or Zdenek?

Sorry for my mistaking you two.

-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Monday, July 23, 2007 11:46 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


Propes, Barry L escribió:
 Like I told him, Chris, I experienced very similar scenarios with my 
 connection pooling, and had to alter and/or rewrite the classes, but I did 
 get them closing properly. 
 Some took some significant tweaking, but I finally got it.

 Zdenek, if you could post the original code, maybe we could narrow it down 
 for you.

 If you'd like to just send me a few files individually, go right ahead. I'll 
 try to take a look at it and be of help.

   
Thank you very much, Barry L. I'm just testing a few changes in the 
code. When I have something I'll say you it.

Note: I'm not Zdenek. I'm Julio.

Regards.
 -Original Message-
 From: Christopher Schultz [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 23, 2007 10:27 AM
 To: Tomcat Users List
 Subject: Re: OracleConnectionPoolDataSource


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Julio,

 Julio J. Suárez Salinero wrote:
   
 Zdeněk Vráblík escribió:
 
 Hi,

   
 4. I use OracleConnectionPoolDataSource because with
 javax.sql.DataSource it doesn't close correctly close connections from
 pool and server got to hang up.
 
 Have you got any exception?

   
 It throwed Closed Statement, Exhausted Resultset and
 NullPointerException, but only when I do stress test. If I browse page
 with navigator it works correctly and throws no exceptions.
 

 This suggests that the connections and statements are not being managed
 properly. Are you sure you are using the pooled connections properly? If
 you had told us what the exceptions you were getting earlier (always a
 good idea to tell us HOW it's not working), I would have said that you
 were leaking connections between requests.

 Closed Statement usually means you're trying to read from a result set
 that came from a statement that has been closed. Why are you trying to
 read from a closed statement? I'm guessing your code doesn't do this:

 PreparedStatement ps = conn.prepareStatement(...);
 ResultSet rs = ps.executeQuery();

 ps.close();
 rs.next();

 ...because that would, of course, be stupid. The only explanation I can
 think of is that somehow those connections and/or statements are being
 accidentally shared by threads.

 Let me ask another stupid question: if this was working before using
 Tomcat's pooling, why are you killing yourself to use Oracle's pooled
 connections when they don't appear to work properly?

 - -chris

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGpMiz9CaO5/Lv0PARAnj6AJ40JQr2/pHY1JeavYSdFUStYpQlSwCfbTRJ
 YG2H7taNbtcp+DtTGIr/vcs=
 =knx7
 -END PGP SIGNATURE-

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

   


-- 


---


*Julio Javier Suárez Salinero*

*Departamento de programación*

AVISO LEGAL: Este mensaje contiene información confidencial para ser 
leída exclusivamente por el destinatario. Su contenido no constituye un 
compromiso para el remitente salvo ratificación escrita por ambas 
partes. Queda prohibida la reproducción, publicación, divulgación, total 
o parcial del mensaje así como el uso no autorizados por el emisor. En 
caso de recibir el mensaje por error se ruega su comunicación al 
remitente lo antes posible.

LEGAL WARNING: This message contains confidential information for the 
exclusive use of the recipient. Its contents do not constitute a 
commitment by the sender except where provided for in a signed agreement 
between both parties. Any unauthorised disclosure, use or dissemination, 
either whole or partial, is prohibited. If you are not the intended 
recipient of the message, please notify.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-20 Thread Julio J. Suárez Salinero
I'll try to answer all your questions and tell you what state is the 
page now.


1. I get the same results with 
oracle.jdbc.pool.OracleConnectionPoolDataSource, 
oracle.jdbc.OracleDriver and oracle.jdbc.driver.OracleDriver. 
Currently I'm using oracle.jdbc.OracleDriver.


2. I am importing javax.naming.* which includes 
javax.naming.Context, import javax.naming.InitialContext and 
javax.naming.NamingException. I think if I were not importing that, it 
would NEVER work, so I think this is not the problem.


3. factory attribute is new. I have found it in google and it began to 
work when I started using it.


4. I use OracleConnectionPoolDataSource because with 
javax.sql.DataSource it doesn't close correctly close connections from 
pool and server got to hang up.


5. con variable is of type Connection. I found this in an example in 
google. May it be of type PooledConnection? If so, can I use pc variable 
instead of con?


6. I've putted user=test password=test in context but it still 
doesn't work if I don't put user and password in getPooledConnection.


Currently context.xml is this:

Context debug=0 reloadable=true
 Resource
   name=jdbc/test auth=Container
   type=oracle.jdbc.pool.OracleConnectionPoolDataSource
   factory=oracle.jdbc.pool.OracleDataSourceFactory
   maxActive=5 maxIdle=-1 maxWait=-1
   removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
   driverClassName=oracle.jdbc.OracleDriver
   url=jdbc:oracle:thin:@192.168.1.47:1521:GLOBALDB /
/Context

And code that gets the connection is this:

   Context initCtx = null;
   PooledConnection pc = null;
   Connection con = null;

   public void init()
   {
 if(pc == null)
 {
   try
   {
 initCtx = new InitialContext();
 Context ctx = (Context) initCtx.lookup(java:/comp/env);
 OracleConnectionPoolDataSource fuenteDatos = 
(OracleConnectionPoolDataSource) ctx.lookup(/jdbc/ganaderia);

 pc = fuenteDatos.getPooledConnection(dbUser, dbPassword);
   }
   catch(Exception e)
   {
 String mensaje = getMessage(e);
 sc.log(mensaje);
   }
 }
 initConnection();
   }

   void initConnection()
   {
   try
   {
   con = pc.getConnection();
   }
   catch(Exception e)
   {
   sc.log(getMessage(e));
   }
   }

   public void finishConnection()
   {
   try
   {
   if(con != null)
   {
   con.close();
   con = null;
   }
   }
   catch(Exception e)
   {
   sc.log(getMessage(e));
   con = null;
   }
   }

   public void finish()
   {
   try
   {
   finishConnection();
   if(pc != null)
   pc.close();
   }
   catch(Exception e)
   {
   sc.log(getMessage(e));
   }   
   }


Currently I can browse the page normally, but when I play stress test, I 
see only one connection and two users cannot log in at the same time.


Seva Popov escribió:

Yes, this is Oracle specific.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 19, 2007 12:24 PM

To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Seva,

Seva Popov wrote:
  

You need to use user=test instead of username=test. This should
work in the context.xml file.



Is this Oracle-specific? I use 'user=username' in my Resource
element and it works perfectly.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn7pZ9CaO5/Lv0PARAtDYAJ994n4wU0MoNpuNiRWm5twz2q6WKACgsXbK
npQLX/vREfNQFCo+NTLRRY8=
=xKxF
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-20 Thread Propes, Barry L
on this:

-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Friday, July 20, 2007 10:13 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource

3. factory attribute is new. I have found it in google and it began to 
work when I started using it.

Could it be the factory class in that jar is either not the 
right one needed or something else could be wrong with it? Maybe you need to
redownload the jar containing it?

4. I use OracleConnectionPoolDataSource because with 
javax.sql.DataSource it doesn't close correctly close connections from 
pool and server got to hang up.

   were you explicitly closing each connection and/or prepared 
statement, or callable statement? I found I had to do the same thing myself or  
 the connections wouldn't close properly.

5. con variable is of type Connection. I found this in an example in 
google. May it be of type PooledConnection? If so, can I use pc variable 
instead of con?
  
I was thinking you might not need to establish Connection con, 
if you're already establishing pooled connection.
But if you do, you might need to declare it first. I was 
thinking, though, that the PooledConnection object would serve as your 
connection.




 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-19 Thread Julio J. Suárez Salinero
I have get it to work from a context resource. I've had to specify a 
factory attribute. Currently context.xml is this:


Context path=/test docBase=test debug=0 reloadable=true 
Resource name=jdbc/test auth=Container
type=oracle.jdbc.pool.OracleConnectionPoolDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
maxActive=0 maxIdle=-1 maxWait=-1
removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@192.168.1.47:1521:GLOBALDB /
/Context

User and password doesn't work in context.xml. I have used a 
getPooledConnection overload:


Context ctx = (Context) initCtx.lookup(java:/comp/env);
OracleConnectionPoolDataSource fuenteDatos = 
(OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);

pc = fuenteDatos.getPooledConnection(dbUser, dbPassword);

dbUser and dbPassword are loaded from a configuration file.

Now, I can set pool maximum size in context.xml, but it still creates 
only one connection and doesn't allow two users to log in at the same time.


Perhaps I am reusing PooledConnection instead of Connection???

Christopher Schultz escribió:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
  

are you importing the following packages?

You maybe should.

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;



Erm if he weren't importing those packages, his code wouldn't
compile. The OP has a problem with /configuration/:

  

I'm Trying to connect a JSP tomcat-based application to Oracle
using OracleConnectionPoolDataSource and related classes. I have
used javax.sql.DataSource an it did work fine. I have made
changes I need for using that classes and when I get the
DataSource it throws exception javax.naming.NamingException:
Cannot create resource instance.



Something is wrong in here:

  

Resource
name=jdbc/test auth=Container
type=oracle.jdbc.pool.OracleConnectionPoolDataSource



I wonder if Tomcat doesn't really know what to do with this type. Why
do you want to use the OracleConnectionPoolDataSource specifically?

  

driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource



This is probably wrong. This class is the same as the one you used for
type, which probably extends javax.sql.DataSource. You want something
that implements java.sql.Driver. Re-check the Oracle documentation to
see what driver class you should really be using.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGnrp09CaO5/Lv0PARAmwgAJ9015dCPWCJvYjYwLBSkPKcAYWuCgCgtrCm
ef63dCd2d0OJUHKoxR0X9Xc=
=u7e9
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Propes, Barry L
how do you know the user and password won't work from the context?
Are you just trying to store it elsewhere or did you try it?

Also, on the driver reference, I saw something on Oracle's site suggesting the 
use of:

oracle.jdbc.OracleDriver, I believe, rather than the full 
oracle.jdbc.driver.OracleDriver

it had said the latter was deprecated. However, that may not be the crux of 
your problem but you could try it.

I have not experimented with the getPooledConnection method so I can't say.


-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 9:43 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


I have get it to work from a context resource. I've had to specify a 
factory attribute. Currently context.xml is this:

Context path=/test docBase=test debug=0 reloadable=true 
Resource name=jdbc/test auth=Container
type=oracle.jdbc.pool.OracleConnectionPoolDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
maxActive=0 maxIdle=-1 maxWait=-1
removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@192.168.1.47:1521:GLOBALDB /
/Context

User and password doesn't work in context.xml. I have used a 
getPooledConnection overload:

Context ctx = (Context) initCtx.lookup(java:/comp/env);
OracleConnectionPoolDataSource fuenteDatos = 
(OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
pc = fuenteDatos.getPooledConnection(dbUser, dbPassword);
 
dbUser and dbPassword are loaded from a configuration file.

Now, I can set pool maximum size in context.xml, but it still creates 
only one connection and doesn't allow two users to log in at the same time.

Perhaps I am reusing PooledConnection instead of Connection???

Christopher Schultz escribió:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Barry,

 Propes, Barry L wrote:
   
 are you importing the following packages?

 You maybe should.

 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 

 Erm if he weren't importing those packages, his code wouldn't
 compile. The OP has a problem with /configuration/:

   
 I'm Trying to connect a JSP tomcat-based application to Oracle
 using OracleConnectionPoolDataSource and related classes. I have
 used javax.sql.DataSource an it did work fine. I have made
 changes I need for using that classes and when I get the
 DataSource it throws exception javax.naming.NamingException:
 Cannot create resource instance.
 

 Something is wrong in here:

   
 Resource
 name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource
 

 I wonder if Tomcat doesn't really know what to do with this type. Why
 do you want to use the OracleConnectionPoolDataSource specifically?

   
 driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource
 

 This is probably wrong. This class is the same as the one you used for
 type, which probably extends javax.sql.DataSource. You want something
 that implements java.sql.Driver. Re-check the Oracle documentation to
 see what driver class you should really be using.

 - -chris

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGnrp09CaO5/Lv0PARAmwgAJ9015dCPWCJvYjYwLBSkPKcAYWuCgCgtrCm
 ef63dCd2d0OJUHKoxR0X9Xc=
 =u7e9
 -END PGP SIGNATURE-

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Propes, Barry L
like here - this is the reference for that info below.

http://www.nabble.com/svn-commit:-r556449tomcat-container-tc5.5.x-webapps-docs-jndi-datasource-examples-howto.xml-t4083357.html



-Original Message-
From: Propes, Barry L [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 10:05 AM
To: Tomcat Users List
Subject: RE: OracleConnectionPoolDataSource


how do you know the user and password won't work from the context?
Are you just trying to store it elsewhere or did you try it?

Also, on the driver reference, I saw something on Oracle's site suggesting the 
use of:

oracle.jdbc.OracleDriver, I believe, rather than the full 
oracle.jdbc.driver.OracleDriver

it had said the latter was deprecated. However, that may not be the crux of 
your problem but you could try it.

I have not experimented with the getPooledConnection method so I can't say, but 
I think it is that you're using PooledConnection rather than Connection.


-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 9:43 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


I have get it to work from a context resource. I've had to specify a 
factory attribute. Currently context.xml is this:

Context path=/test docBase=test debug=0 reloadable=true 
Resource name=jdbc/test auth=Container
type=oracle.jdbc.pool.OracleConnectionPoolDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
maxActive=0 maxIdle=-1 maxWait=-1
removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@192.168.1.47:1521:GLOBALDB /
/Context

User and password doesn't work in context.xml. I have used a 
getPooledConnection overload:

Context ctx = (Context) initCtx.lookup(java:/comp/env);
OracleConnectionPoolDataSource fuenteDatos = 
(OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
pc = fuenteDatos.getPooledConnection(dbUser, dbPassword);
 
dbUser and dbPassword are loaded from a configuration file.

Now, I can set pool maximum size in context.xml, but it still creates 
only one connection and doesn't allow two users to log in at the same time.

Perhaps I am reusing PooledConnection instead of Connection???

Christopher Schultz escribió:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Barry,

 Propes, Barry L wrote:
   
 are you importing the following packages?

 You maybe should.

 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 

 Erm if he weren't importing those packages, his code wouldn't
 compile. The OP has a problem with /configuration/:

   
 I'm Trying to connect a JSP tomcat-based application to Oracle
 using OracleConnectionPoolDataSource and related classes. I have
 used javax.sql.DataSource an it did work fine. I have made
 changes I need for using that classes and when I get the
 DataSource it throws exception javax.naming.NamingException:
 Cannot create resource instance.
 

 Something is wrong in here:

   
 Resource
 name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource
 

 I wonder if Tomcat doesn't really know what to do with this type. Why
 do you want to use the OracleConnectionPoolDataSource specifically?

   
 driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource
 

 This is probably wrong. This class is the same as the one you used for
 type, which probably extends javax.sql.DataSource. You want something
 that implements java.sql.Driver. Re-check the Oracle documentation to
 see what driver class you should really be using.

 - -chris

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGnrp09CaO5/Lv0PARAmwgAJ9015dCPWCJvYjYwLBSkPKcAYWuCgCgtrCm
 ef63dCd2d0OJUHKoxR0X9Xc=
 =u7e9
 -END PGP SIGNATURE-

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-19 Thread Julio J. Suárez Salinero

Propes, Barry L escribió:

how do you know the user and password won't work from the context?
Are you just trying to store it elsewhere or did you try it?

  
Because when I set user and password in the context (username=test 
password=test) and get the connection with
pc = fuenteDatos.getPooledConnection(); it throws invalid arguments in 
call. I have to put them in getPooledConnection. I have tried it.

Also, on the driver reference, I saw something on Oracle's site suggesting the 
use of:

oracle.jdbc.OracleDriver, I believe, rather than the full 
oracle.jdbc.driver.OracleDriver

it had said the latter was deprecated. However, that may not be the crux of 
your problem but you could try it.

  

Thanks for the advice. I'll try it.

I have not experimented with the getPooledConnection method so I can't say.


-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 9:43 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


I have get it to work from a context resource. I've had to specify a 
factory attribute. Currently context.xml is this:


Context path=/test docBase=test debug=0 reloadable=true 
Resource name=jdbc/test auth=Container
type=oracle.jdbc.pool.OracleConnectionPoolDataSource
factory=oracle.jdbc.pool.OracleDataSourceFactory
maxActive=0 maxIdle=-1 maxWait=-1
removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@192.168.1.47:1521:GLOBALDB /
/Context

User and password doesn't work in context.xml. I have used a 
getPooledConnection overload:


Context ctx = (Context) initCtx.lookup(java:/comp/env);
OracleConnectionPoolDataSource fuenteDatos = 
(OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);

pc = fuenteDatos.getPooledConnection(dbUser, dbPassword);
 
dbUser and dbPassword are loaded from a configuration file.


Now, I can set pool maximum size in context.xml, but it still creates 
only one connection and doesn't allow two users to log in at the same time.


Perhaps I am reusing PooledConnection instead of Connection???

Christopher Schultz escribió:
  

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
  


are you importing the following packages?

You maybe should.

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

  

Erm if he weren't importing those packages, his code wouldn't
compile. The OP has a problem with /configuration/:

  


I'm Trying to connect a JSP tomcat-based application to Oracle
using OracleConnectionPoolDataSource and related classes. I have
used javax.sql.DataSource an it did work fine. I have made
changes I need for using that classes and when I get the
DataSource it throws exception javax.naming.NamingException:
Cannot create resource instance.

  

Something is wrong in here:

  


Resource
name=jdbc/test auth=Container
type=oracle.jdbc.pool.OracleConnectionPoolDataSource

  

I wonder if Tomcat doesn't really know what to do with this type. Why
do you want to use the OracleConnectionPoolDataSource specifically?

  


driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource

  

This is probably wrong. This class is the same as the one you used for
type, which probably extends javax.sql.DataSource. You want something
that implements java.sql.Driver. Re-check the Oracle documentation to
see what driver class you should really be using.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGnrp09CaO5/Lv0PARAmwgAJ9015dCPWCJvYjYwLBSkPKcAYWuCgCgtrCm
ef63dCd2d0OJUHKoxR0X9Xc=
=u7e9
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Seva Popov
You need to use user=test instead of username=test. This should work in the 
context.xml file.

-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 19, 2007 8:16 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource

Propes, Barry L escribió:
 how do you know the user and password won't work from the context?
 Are you just trying to store it elsewhere or did you try it?

   
Because when I set user and password in the context (username=test 
password=test) and get the connection with
pc = fuenteDatos.getPooledConnection(); it throws invalid arguments in 
call. I have to put them in getPooledConnection. I have tried it.
 Also, on the driver reference, I saw something on Oracle's site suggesting 
 the use of:

 oracle.jdbc.OracleDriver, I believe, rather than the full 
 oracle.jdbc.driver.OracleDriver

 it had said the latter was deprecated. However, that may not be the crux of 
 your problem but you could try it.

   
Thanks for the advice. I'll try it.
 I have not experimented with the getPooledConnection method so I can't say.


 -Original Message-
 From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 19, 2007 9:43 AM
 To: Tomcat Users List
 Subject: Re: OracleConnectionPoolDataSource


 I have get it to work from a context resource. I've had to specify a 
 factory attribute. Currently context.xml is this:

 Context path=/test docBase=test debug=0 reloadable=true 
 Resource name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 maxActive=0 maxIdle=-1 maxWait=-1
 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
 driverClassName=oracle.jdbc.driver.OracleDriver
 url=jdbc:oracle:thin:@192.168.1.47:1521:GLOBALDB /
 /Context

 User and password doesn't work in context.xml. I have used a 
 getPooledConnection overload:

 Context ctx = (Context) initCtx.lookup(java:/comp/env);
 OracleConnectionPoolDataSource fuenteDatos = 
 (OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
 pc = fuenteDatos.getPooledConnection(dbUser, dbPassword);
  
 dbUser and dbPassword are loaded from a configuration file.

 Now, I can set pool maximum size in context.xml, but it still creates 
 only one connection and doesn't allow two users to log in at the same time.

 Perhaps I am reusing PooledConnection instead of Connection???

 Christopher Schultz escribió:
   
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Barry,

 Propes, Barry L wrote:
   
 
 are you importing the following packages?

 You maybe should.

 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
   
 Erm if he weren't importing those packages, his code wouldn't
 compile. The OP has a problem with /configuration/:

   
 
 I'm Trying to connect a JSP tomcat-based application to Oracle
 using OracleConnectionPoolDataSource and related classes. I have
 used javax.sql.DataSource an it did work fine. I have made
 changes I need for using that classes and when I get the
 DataSource it throws exception javax.naming.NamingException:
 Cannot create resource instance.
 
   
 Something is wrong in here:

   
 
 Resource
 name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource
 
   
 I wonder if Tomcat doesn't really know what to do with this type. Why
 do you want to use the OracleConnectionPoolDataSource specifically?

   
 
 driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource
 
   
 This is probably wrong. This class is the same as the one you used for
 type, which probably extends javax.sql.DataSource. You want something
 that implements java.sql.Driver. Re-check the Oracle documentation to
 see what driver class you should really be using.

 - -chris

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFGnrp09CaO5/Lv0PARAmwgAJ9015dCPWCJvYjYwLBSkPKcAYWuCgCgtrCm
 ef63dCd2d0OJUHKoxR0X9Xc=
 =u7e9
 -END PGP SIGNATURE-

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   
 

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

   


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org

Re: OracleConnectionPoolDataSource

2007-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Julio,

Julio J. Suárez Salinero wrote:
 Context path=/test docBase=test debug=0 reloadable=true 

Seriously... get rid of those path and docBase attributes.

 Resource name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource
 factory=oracle.jdbc.pool.OracleDataSourceFactory

You didn't have a factory attribute last time, did you?

 driverClassName=oracle.jdbc.driver.OracleDriver

That looks much better. Before, you had the DataSource as the
driverClassName. Are you getting the same error, now?

 User and password doesn't work in context.xml.

Huh? If that's true, then you have a crappy DataSource and/or Factory
implementation.

 Context ctx = (Context) initCtx.lookup(java:/comp/env);
 OracleConnectionPoolDataSource fuenteDatos =
 (OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
 pc = fuenteDatos.getPooledConnection(dbUser, dbPassword);

I wouldn't be surprised if Tomcat didn't try to create Connection
objects right away when you use the Resource. If you need a username
and password from somewhere else, then Tomcat might fail, requiring you
to hand-insert the DataSource into JNDI. shrug

Again... why not just use the built-in DataSource and pooling
mechanisms? It seems just so much easier...

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn7nL9CaO5/Lv0PARAndAAKCnrrOERCf5Y4Hv0jwKXwtIzW139wCfW8G9
0a8qRox4HdfsLw65BjMisP4=
=q3fq
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Seva,

Seva Popov wrote:
 You need to use user=test instead of username=test. This should
 work in the context.xml file.

Is this Oracle-specific? I use 'user=username' in my Resource
element and it works perfectly.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn7pZ9CaO5/Lv0PARAtDYAJ994n4wU0MoNpuNiRWm5twz2q6WKACgsXbK
npQLX/vREfNQFCo+NTLRRY8=
=xKxF
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Propes, Barry L
and maybe I overlooked it, but where is the variable con intialized?

Almost looks like you're calling con from a Connection class rather than a 
PooledConnection class. Am I seeing that incorrectly?

 Code that creates connection:

 initCtx = new InitialContext();
 ctx = (Context) initCtx.lookup(java:/comp/env);
 fuenteDatos = (OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
 PooledConnection pc = fuenteDatos.getPooledConnection();
 con = pc.getConnection();


-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2007 8:07 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


Zdeněk Vráblík escribió:
 Hi,

 There is error in driverClassName.

 Try use this:
 driverClassName=oracle.jdbc.driver.OracleDriver

Thanks, but I already have tested that with the same results.
 Zdenek

 On 7/18/07, Julio J. Suárez Salinero [EMAIL PROTECTED] wrote:
 I'm Trying to connect a JSP tomcat-based application to Oracle using
 OracleConnectionPoolDataSource and related classes. I have used
 javax.sql.DataSource an it did work fine. I have made changes I need for
 using that classes and when I get the DataSource it throws exception
 javax.naming.NamingException: Cannot create resource instance.

 Changes I have made are these:

 In context.xml:

 Context path=/test docBase=test debug=0
 reloadable=true 
 Resource
 name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource
 maxActive=0 maxIdle=-1 maxWait=-1
 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
 username=test password=test
 driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource
 url=jdbc:oracle:thin:@192.168.1.109:1521:GLOBALDB /
 /Context

 In web.xml (only resource-ref):

 resource-ref
 res-ref-namejdbc/test/res-ref-name
 res-typeoracle.jdbc.pool.OracleConnectionPoolDataSource/res-type
 res-authContainer/res-auth
 /resource-ref

 Code that creates connection:

 initCtx = new InitialContext();
 ctx = (Context) initCtx.lookup(java:/comp/env);
 fuenteDatos = (OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
 PooledConnection pc = fuenteDatos.getPooledConnection();
 con = pc.getConnection();

 I have searched in google and found some examples that use
 oracle.jdbc.driver.OracleDriver in driverClassName. I have also tried
 this option with the same results. I suppose bug is elsewhere.

 I have tried to create DataSource instance in the code instead of get it
 from resource. Doing this it drops no error and page works, but I don't
 know how can I control maximun number of pooled connections. This is the
 code I have used for that:

 initCtx = new InitialContext();
 OracleConnectionPoolDataSource fuenteDatos = new
 OracleConnectionPoolDataSource();
 fuenteDatos.setDataSourceName(oracle.jdbc.pool.OracleConnectionPoolDataSource);
  

 fuenteDatos.setURL(dbURL);
 fuenteDatos.setDescription(DS);
 fuenteDatos.setUser(dbUsuario);
 fuenteDatos.setPassword(dbPassword);
 initCtx.rebind(DS, fuenteDatos);
 pc = fuenteDatos.getPooledConnection();

 But it creates only one connection and doesn't allow two users to log in
 at the same time.

 Please. I need help.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 


---


*Julio Javier Suárez Salinero*

*Departamento de programación*

AVISO LEGAL: Este mensaje contiene información confidencial para ser 
leída exclusivamente por el destinatario. Su contenido no constituye un 
compromiso para el remitente salvo ratificación escrita por ambas 
partes. Queda prohibida la reproducción, publicación, divulgación, total 
o parcial del mensaje así como el uso no autorizados por el emisor. En 
caso de recibir el mensaje por error se ruega su comunicación al 
remitente lo antes posible.

LEGAL WARNING: This message contains confidential information for the 
exclusive use of the recipient. Its contents do not constitute a 
commitment by the sender except where provided for in a signed agreement 
between both parties. Any unauthorised disclosure, use or dissemination, 
either whole or partial, is prohibited. If you are not the intended 
recipient of the message, please notify.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Propes, Barry L
I thought I saw the OP had an exception error of javax.naming.NamingException.

in part of the thread, this was posted. 

Zdeněk Vráblík escribió:
 Hi,

 There is error in driverClassName.

 Try use this:
 driverClassName=oracle.jdbc.driver.OracleDriver

Thanks, but I already have tested that with the same results.
 Zdenek

 On 7/18/07, Julio J. Suárez Salinero [EMAIL PROTECTED] wrote:
 I'm Trying to connect a JSP tomcat-based application to Oracle using
 OracleConnectionPoolDataSource and related classes. I have used
 javax.sql.DataSource an it did work fine. I have made changes I need for
 using that classes and when I get the DataSource it throws exception




 javax.naming.NamingException: Cannot create resource instance.

 Changes I have made are these:


That's why I thought he needed to import that package.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2007 8:12 PM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
 are you importing the following packages?
 
 You maybe should.
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;

Erm if he weren't importing those packages, his code wouldn't
compile. The OP has a problem with /configuration/:

 I'm Trying to connect a JSP tomcat-based application to Oracle
 using OracleConnectionPoolDataSource and related classes. I have
 used javax.sql.DataSource an it did work fine. I have made
 changes I need for using that classes and when I get the
 DataSource it throws exception javax.naming.NamingException:
 Cannot create resource instance.

Something is wrong in here:

 Resource
 name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource

I wonder if Tomcat doesn't really know what to do with this type. Why
do you want to use the OracleConnectionPoolDataSource specifically?

 driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource

This is probably wrong. This class is the same as the one you used for
type, which probably extends javax.sql.DataSource. You want something
that implements java.sql.Driver. Re-check the Oracle documentation to
see what driver class you should really be using.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGnrp09CaO5/Lv0PARAmwgAJ9015dCPWCJvYjYwLBSkPKcAYWuCgCgtrCm
ef63dCd2d0OJUHKoxR0X9Xc=
=u7e9
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Propes, Barry L
it's NOT Oracle specific.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 2:24 PM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Seva,

Seva Popov wrote:
 You need to use user=test instead of username=test. This should
 work in the context.xml file.

Is this Oracle-specific? I use 'user=username' in my Resource
element and it works perfectly.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn7pZ9CaO5/Lv0PARAtDYAJ994n4wU0MoNpuNiRWm5twz2q6WKACgsXbK
npQLX/vREfNQFCo+NTLRRY8=
=xKxF
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
 it's NOT Oracle specific.

If the user attribute is not Oracle-specific, then Seva is out of his
mind:

 Seva Popov wrote:
 You need to use user=test instead of username=test. This should
 work in the context.xml file.

Since I use username as the attribute to define my username and it works.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn9Ef9CaO5/Lv0PARAo6aAJ9pZpUMyqK6EFd2Qppoyb7QJopE9QCZAWpx
hK8kq8iN2xSkqW9VbRgchTg=
=icnE
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Propes, Barry L
I do use user, but it's not required by OracleI could use something like 
o_user if I wanted to.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 4:01 PM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
 it's NOT Oracle specific.

If the user attribute is not Oracle-specific, then Seva is out of his
mind:

 Seva Popov wrote:
 You need to use user=test instead of username=test. This should
 work in the context.xml file.

Since I use username as the attribute to define my username and it works.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn9Ef9CaO5/Lv0PARAo6aAJ9pZpUMyqK6EFd2Qppoyb7QJopE9QCZAWpx
hK8kq8iN2xSkqW9VbRgchTg=
=icnE
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
 I do use user, but it's not required by OracleI could use
 something like o_user if I wanted to.

Huh? You can do this:

Resource ...
   o_user=my_username
   ...
   /

... and it will work? Through what voodoo does that work?

I thought that the Resource element ended up just looking for a method
called set[AttributeName](value) on whatever object type you specified
in the type parameter. Unless Tomcat's implementation of
javax.sql.DataSource includes a setO_user method, o_user as an
attribute won't work... will it?

I feel like I'm losing my mind, here...

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn9Og9CaO5/Lv0PARAs0NAJ9Z4a8BoT11J8UkmvE91C89wMUJVwCcCY7C
iA4eaQ1W3sA0Vd3k5BHNoz0=
=PIEk
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Propes, Barry L
no, not for the resource tag. Sorry -- but for the table title. My apologies.


-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 4:12 PM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
 I do use user, but it's not required by OracleI could use
 something like o_user if I wanted to.

Huh? You can do this:

Resource ...
   o_user=my_username
   ...
   /

... and it will work? Through what voodoo does that work?

I thought that the Resource element ended up just looking for a method
called set[AttributeName](value) on whatever object type you specified
in the type parameter. Unless Tomcat's implementation of
javax.sql.DataSource includes a setO_user method, o_user as an
attribute won't work... will it?

I feel like I'm losing my mind, here...

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn9Og9CaO5/Lv0PARAs0NAJ9Z4a8BoT11J8UkmvE91C89wMUJVwCcCY7C
iA4eaQ1W3sA0Vd3k5BHNoz0=
=PIEk
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Propes, Barry L
my apology, Chris. After I sent that last one out, I said, wait, that's 
confusing and doesn't sound correct!
It wasn't...just the table col. My apologies again.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 19, 2007 4:12 PM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
 I do use user, but it's not required by OracleI could use
 something like o_user if I wanted to.

Huh? You can do this:

Resource ...
   o_user=my_username
   ...
   /

... and it will work? Through what voodoo does that work?

I thought that the Resource element ended up just looking for a method
called set[AttributeName](value) on whatever object type you specified
in the type parameter. Unless Tomcat's implementation of
javax.sql.DataSource includes a setO_user method, o_user as an
attribute won't work... will it?

I feel like I'm losing my mind, here...

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn9Og9CaO5/Lv0PARAs0NAJ9Z4a8BoT11J8UkmvE91C89wMUJVwCcCY7C
iA4eaQ1W3sA0Vd3k5BHNoz0=
=PIEk
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-19 Thread Seva Popov
Yes, this is Oracle specific.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 19, 2007 12:24 PM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Seva,

Seva Popov wrote:
 You need to use user=test instead of username=test. This should
 work in the context.xml file.

Is this Oracle-specific? I use 'user=username' in my Resource
element and it works perfectly.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGn7pZ9CaO5/Lv0PARAtDYAJ994n4wU0MoNpuNiRWm5twz2q6WKACgsXbK
npQLX/vREfNQFCo+NTLRRY8=
=xKxF
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-18 Thread Caldarale, Charles R
 From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED] 
 Subject: OracleConnectionPoolDataSource 
 
 I'm Trying to connect a JSP tomcat-based application to Oracle using 
 OracleConnectionPoolDataSource and related classes.

Don't suppose you'd be interested in telling us the version of Tomcat you're 
using?

 In context.xml:
 Context path=/test docBase=test debug=0 reloadable=true 

If you're on Tomcat 5.0 or above, remove the path and docBase attributes; they 
may not be used when the Context element is in META-INF/context.xml.  (That 
won't solve your problem, but let's get the obvious errors corrected first.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-18 Thread Zdeněk Vráblík

Hi,

There is error in driverClassName.

Try use this:
driverClassName=oracle.jdbc.driver.OracleDriver

Zdenek

On 7/18/07, Julio J. Suárez Salinero [EMAIL PROTECTED] wrote:

I'm Trying to connect a JSP tomcat-based application to Oracle using
OracleConnectionPoolDataSource and related classes. I have used
javax.sql.DataSource an it did work fine. I have made changes I need for
using that classes and when I get the DataSource it throws exception
javax.naming.NamingException: Cannot create resource instance.

Changes I have made are these:

In context.xml:

Context path=/test docBase=test debug=0
reloadable=true 
 Resource
name=jdbc/test auth=Container
type=oracle.jdbc.pool.OracleConnectionPoolDataSource
maxActive=0 maxIdle=-1 maxWait=-1
removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
username=test password=test
driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource
url=jdbc:oracle:thin:@192.168.1.109:1521:GLOBALDB /
/Context

In web.xml (only resource-ref):

resource-ref
 res-ref-namejdbc/test/res-ref-name
 res-typeoracle.jdbc.pool.OracleConnectionPoolDataSource/res-type
 res-authContainer/res-auth
/resource-ref

Code that creates connection:

 initCtx = new InitialContext();
 ctx = (Context) initCtx.lookup(java:/comp/env);
 fuenteDatos = (OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
 PooledConnection pc = fuenteDatos.getPooledConnection();
 con = pc.getConnection();

I have searched in google and found some examples that use
oracle.jdbc.driver.OracleDriver in driverClassName. I have also tried
this option with the same results. I suppose bug is elsewhere.

I have tried to create DataSource instance in the code instead of get it
from resource. Doing this it drops no error and page works, but I don't
know how can I control maximun number of pooled connections. This is the
code I have used for that:

 initCtx = new InitialContext();
 OracleConnectionPoolDataSource fuenteDatos = new
OracleConnectionPoolDataSource();
 
fuenteDatos.setDataSourceName(oracle.jdbc.pool.OracleConnectionPoolDataSource);
 fuenteDatos.setURL(dbURL);
 fuenteDatos.setDescription(DS);
 fuenteDatos.setUser(dbUsuario);
 fuenteDatos.setPassword(dbPassword);
 initCtx.rebind(DS, fuenteDatos);
 pc = fuenteDatos.getPooledConnection();

But it creates only one connection and doesn't allow two users to log in
at the same time.

Please. I need help.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-18 Thread Julio J. Suárez Salinero

Zdeněk Vráblík escribió:

Hi,

There is error in driverClassName.

Try use this:
driverClassName=oracle.jdbc.driver.OracleDriver


Thanks, but I already have tested that with the same results.

Zdenek

On 7/18/07, Julio J. Suárez Salinero [EMAIL PROTECTED] wrote:

I'm Trying to connect a JSP tomcat-based application to Oracle using
OracleConnectionPoolDataSource and related classes. I have used
javax.sql.DataSource an it did work fine. I have made changes I need for
using that classes and when I get the DataSource it throws exception
javax.naming.NamingException: Cannot create resource instance.

Changes I have made are these:

In context.xml:

Context path=/test docBase=test debug=0
reloadable=true 
Resource
name=jdbc/test auth=Container
type=oracle.jdbc.pool.OracleConnectionPoolDataSource
maxActive=0 maxIdle=-1 maxWait=-1
removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
username=test password=test
driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource
url=jdbc:oracle:thin:@192.168.1.109:1521:GLOBALDB /
/Context

In web.xml (only resource-ref):

resource-ref
res-ref-namejdbc/test/res-ref-name
res-typeoracle.jdbc.pool.OracleConnectionPoolDataSource/res-type
res-authContainer/res-auth
/resource-ref

Code that creates connection:

initCtx = new InitialContext();
ctx = (Context) initCtx.lookup(java:/comp/env);
fuenteDatos = (OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
PooledConnection pc = fuenteDatos.getPooledConnection();
con = pc.getConnection();

I have searched in google and found some examples that use
oracle.jdbc.driver.OracleDriver in driverClassName. I have also tried
this option with the same results. I suppose bug is elsewhere.

I have tried to create DataSource instance in the code instead of get it
from resource. Doing this it drops no error and page works, but I don't
know how can I control maximun number of pooled connections. This is the
code I have used for that:

initCtx = new InitialContext();
OracleConnectionPoolDataSource fuenteDatos = new
OracleConnectionPoolDataSource();
fuenteDatos.setDataSourceName(oracle.jdbc.pool.OracleConnectionPoolDataSource); 


fuenteDatos.setURL(dbURL);
fuenteDatos.setDescription(DS);
fuenteDatos.setUser(dbUsuario);
fuenteDatos.setPassword(dbPassword);
initCtx.rebind(DS, fuenteDatos);
pc = fuenteDatos.getPooledConnection();

But it creates only one connection and doesn't allow two users to log in
at the same time.

Please. I need help.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--


---


*Julio Javier Suárez Salinero*

*Departamento de programación*

AVISO LEGAL: Este mensaje contiene información confidencial para ser 
leída exclusivamente por el destinatario. Su contenido no constituye un 
compromiso para el remitente salvo ratificación escrita por ambas 
partes. Queda prohibida la reproducción, publicación, divulgación, total 
o parcial del mensaje así como el uso no autorizados por el emisor. En 
caso de recibir el mensaje por error se ruega su comunicación al 
remitente lo antes posible.


LEGAL WARNING: This message contains confidential information for the 
exclusive use of the recipient. Its contents do not constitute a 
commitment by the sender except where provided for in a signed agreement 
between both parties. Any unauthorised disclosure, use or dissemination, 
either whole or partial, is prohibited. If you are not the intended 
recipient of the message, please notify.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-18 Thread Julio J. Suárez Salinero

Caldarale, Charles R escribió:
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED] 
Subject: OracleConnectionPoolDataSource 

I'm Trying to connect a JSP tomcat-based application to Oracle using 
OracleConnectionPoolDataSource and related classes.



Don't suppose you'd be interested in telling us the version of Tomcat you're 
using?

  
You're right. Sorry. I'm using Apache Tomcat 5.5.23 for windows, Java 
JDK 1.5.0_05 and Oracle 9i Release 2 (9.2.0.1.0). All for windows.

In context.xml:
Context path=/test docBase=test debug=0 reloadable=true 



If you're on Tomcat 5.0 or above, remove the path and docBase attributes; they may 
not be used when the Context element is in META-INF/context.xml.  (That won't 
solve your problem, but let's get the obvious errors corrected first.)

 - Chuck

  

Thanks for the advice. I'll take note.

THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: OracleConnectionPoolDataSource

2007-07-18 Thread Propes, Barry L
are you importing the following packages?

You maybe should.

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

-Original Message-
From: Julio J. Suárez Salinero [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2007 8:07 AM
To: Tomcat Users List
Subject: Re: OracleConnectionPoolDataSource


Zdeněk Vráblík escribió:
 Hi,

 There is error in driverClassName.

 Try use this:
 driverClassName=oracle.jdbc.driver.OracleDriver

Thanks, but I already have tested that with the same results.
 Zdenek

 On 7/18/07, Julio J. Suárez Salinero [EMAIL PROTECTED] wrote:
 I'm Trying to connect a JSP tomcat-based application to Oracle using
 OracleConnectionPoolDataSource and related classes. I have used
 javax.sql.DataSource an it did work fine. I have made changes I need for
 using that classes and when I get the DataSource it throws exception
 javax.naming.NamingException: Cannot create resource instance.

 Changes I have made are these:

 In context.xml:

 Context path=/test docBase=test debug=0
 reloadable=true 
 Resource
 name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource
 maxActive=0 maxIdle=-1 maxWait=-1
 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true
 username=test password=test
 driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource
 url=jdbc:oracle:thin:@192.168.1.109:1521:GLOBALDB /
 /Context

 In web.xml (only resource-ref):

 resource-ref
 res-ref-namejdbc/test/res-ref-name
 res-typeoracle.jdbc.pool.OracleConnectionPoolDataSource/res-type
 res-authContainer/res-auth
 /resource-ref

 Code that creates connection:

 initCtx = new InitialContext();
 ctx = (Context) initCtx.lookup(java:/comp/env);
 fuenteDatos = (OracleConnectionPoolDataSource) ctx.lookup(/jdbc/test);
 PooledConnection pc = fuenteDatos.getPooledConnection();
 con = pc.getConnection();

 I have searched in google and found some examples that use
 oracle.jdbc.driver.OracleDriver in driverClassName. I have also tried
 this option with the same results. I suppose bug is elsewhere.

 I have tried to create DataSource instance in the code instead of get it
 from resource. Doing this it drops no error and page works, but I don't
 know how can I control maximun number of pooled connections. This is the
 code I have used for that:

 initCtx = new InitialContext();
 OracleConnectionPoolDataSource fuenteDatos = new
 OracleConnectionPoolDataSource();
 fuenteDatos.setDataSourceName(oracle.jdbc.pool.OracleConnectionPoolDataSource);
  

 fuenteDatos.setURL(dbURL);
 fuenteDatos.setDescription(DS);
 fuenteDatos.setUser(dbUsuario);
 fuenteDatos.setPassword(dbPassword);
 initCtx.rebind(DS, fuenteDatos);
 pc = fuenteDatos.getPooledConnection();

 But it creates only one connection and doesn't allow two users to log in
 at the same time.

 Please. I need help.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 


---


*Julio Javier Suárez Salinero*

*Departamento de programación*

AVISO LEGAL: Este mensaje contiene información confidencial para ser 
leída exclusivamente por el destinatario. Su contenido no constituye un 
compromiso para el remitente salvo ratificación escrita por ambas 
partes. Queda prohibida la reproducción, publicación, divulgación, total 
o parcial del mensaje así como el uso no autorizados por el emisor. En 
caso de recibir el mensaje por error se ruega su comunicación al 
remitente lo antes posible.

LEGAL WARNING: This message contains confidential information for the 
exclusive use of the recipient. Its contents do not constitute a 
commitment by the sender except where provided for in a signed agreement 
between both parties. Any unauthorised disclosure, use or dissemination, 
either whole or partial, is prohibited. If you are not the intended 
recipient of the message, please notify.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OracleConnectionPoolDataSource

2007-07-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry,

Propes, Barry L wrote:
 are you importing the following packages?
 
 You maybe should.
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;

Erm if he weren't importing those packages, his code wouldn't
compile. The OP has a problem with /configuration/:

 I'm Trying to connect a JSP tomcat-based application to Oracle
 using OracleConnectionPoolDataSource and related classes. I have
 used javax.sql.DataSource an it did work fine. I have made
 changes I need for using that classes and when I get the
 DataSource it throws exception javax.naming.NamingException:
 Cannot create resource instance.

Something is wrong in here:

 Resource
 name=jdbc/test auth=Container
 type=oracle.jdbc.pool.OracleConnectionPoolDataSource

I wonder if Tomcat doesn't really know what to do with this type. Why
do you want to use the OracleConnectionPoolDataSource specifically?

 driverClassName=oracle.jdbc.pool.OracleConnectionPoolDataSource

This is probably wrong. This class is the same as the one you used for
type, which probably extends javax.sql.DataSource. You want something
that implements java.sql.Driver. Re-check the Oracle documentation to
see what driver class you should really be using.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGnrp09CaO5/Lv0PARAmwgAJ9015dCPWCJvYjYwLBSkPKcAYWuCgCgtrCm
ef63dCd2d0OJUHKoxR0X9Xc=
=u7e9
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]