Have you tried the advice at the bottom of every email you receive from
this list?
If you have and it still doesn't work, please send a message to
user-owner (at) tomcat.apache.org and ask them to remove you.
--David
Dantas, Thiago wrote:
>Dears,
>
>Please take my e-mail out from this current.
>
>Thanks
>
>
>
>________________________________
>
>
>
>
>
>Thiago Dantas
>Procurement
>Global Procurement
>
>55 11 4197-4592
>thiago.dantas@(protected)
>http://www.hp.com.br
>
>________________________________
>
>Esta mensagem (incluindo qualquer anexo) e os arquivos nela contidos ? confidencial e legalmente protegida, somente podendo ser usada pelo indiv?duo ou entidade a quem foi endere?ada. Caso voc? a tenha recebido por engano, dever? devolv?-la ao remetente e, posteriormente, apag?-la, pois, a dissemina??o, encaminhamento, uso, impress?o ou c?pia do conte?do desta mensagem s?o expressamente proibidos.
>
>This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly rohibited.
>
>
>-----Original Message-----
>From: vrablik@(protected)
>Sent: Friday, July 20, 2007 12:48 PM
>To: Tomcat Users List
>Subject: Re: OracleConnectionPoolDataSource
>
>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?
>
>
>
>>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 am using interface OracleConnection becouse sam libraries needs this
>interface instead of Connection interface
>
>
>
>>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:@(protected)" />
>>
>>
>
>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:@(protected)"
> maxActive="20" maxIdle="10" maxwait="-1"/>
>
>
>></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));
>> }
>> }
>>
>>
>>
>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;
> }
>
>What jdbc driver do you use?
>
>And one question. Are you going to use any user transaction manager? :)
>I use simpleJTA, but I have tested it only in developement...
>
>Regards,
>Zdenek
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@(protected)
>To unsubscribe, e-mail: users-unsubscribe@(protected)
>For additional commands, e-mail: users-help@(protected)
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@(protected)
>To unsubscribe, e-mail: users-unsubscribe@(protected)
>For additional commands, e-mail: users-help@(protected)
>
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)