Good info, thank you Justin!

Unfortunately, it didn't solve my problem, but I will leave the commits
there regardless.  Thanks again!

Any other suggestions out there?  Can anyone verify if Tyrex, as shipped
with 4.0.6, does in fact pool connections?  I could always drop back and
punt to that.

Frank W. Zammetti
Web Architect Consultant
PFPC Global Fund Services
760 Moore Road
King Of Prussia, PA 19406
Mailstop: F4-F760-2B-3
eMail: [EMAIL PROTECTED]
Phone: (610)/382-8243
FAX: (610)/382-8866
Cell: (484)/302-1402



|---------+--------------------------->
|         |           Justin          |
|         |           Ruthenbeck      |
|         |           <[EMAIL PROTECTED]|
|         |           ine.com>        |
|         |                           |
|         |           12/23/2003 02:25|
|         |           PM              |
|         |           Please respond  |
|         |           to "Tomcat Users|
|         |           List"           |
|         |                           |
|---------+--------------------------->
  
>--------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                      |
  |        To:      "Tomcat Users List" <[EMAIL PROTECTED]>                            
                         |
  |        cc:                                                                         
                                      |
  |        Subject: Re: Problem with database updates using DBCP                       
                                      |
  
>--------------------------------------------------------------------------------------------------------------------------|



At 11:10 AM 12/23/2003, you wrote:

>Yep, I thought of that too. But,  I explicitly call
>conn.setAutoCommit(true); before every update, insert or delete.  When
>batching I call it with false and then executeBatch, and calling rollback
>if the batch fails, all pretty typical code I think.  Is there anything
>else I should be doing do you think?  Should I explicitly call commit()
>after a successful executeUpdate() (I haven't tried that, you just made me
>think of it - seems like overkill, but maybe?)

Don't rely on the setAutoCommit(boolean) method to do anything -- I have
seen appservers/conn pools that do not support the method and ignore your
"suggestion" (early 3.X jBoss comes to mind), always using the
hard-configured values.  Always explicitly call either commit() or
rollback() to insulate yourself from these details.

Merry Christmas!
justin
|
>   |        To:      Tomcat Users List
> <[EMAIL PROTECTED]>
> |
>   |        cc:
>                                                       |
>   |        Subject: Re: Problem with database updates using
> DBCP                                                             |
>
>  >
--------------------------------------------------------------------------------------------------------------------------|

>
>
>
>I've not used DBCP specifically but are you sure you are committing
>your writes? Most pools will default rollback connections returned to
>the pool, if I am not mistaken.
>
>
>
>--- [EMAIL PROTECTED] wrote:
> > Hello all.  I've recently had a need to implement connection pooling
> > under
> > Tomcat 4.0.6 (I can't upgrade versions as per a mandate by my
> > employer).  I
> > have read some posts that indicate that Tyrex does not actually pool
> > connections.  I don't know for sure if that is true or not (any
> > definitive
> > answers here?), so I decided to use DBCP, since I knew that did.
> >
> > I grabbed the latest builds of DBCP, collections and pool (1.1, 2.1
> > and 1.1
> > respectively), stuck them in tomcat/common/lib, added my JNDI entry
> > to the
> > app's context in server.xml, added the proper ref tags in web.xml and
> > put
> > in the appropriate code to get a connection from the pool (set to
> > maxActive=50, maxIdle=50000, maxWait=1000 and minIdle=10).
> >
> > Now, I've got it up and running without much trouble.  Everything
> > SEEMED to
> > be working fine, until I realized that all my database writes
> > (updates,
> > inserts, deletes) were NOT hitting the database.
> >
> > There are NO exceptions being thrown anywhere of any kind.  All the
> > relevant objects (statements, connection, etc.) are non-null.  Return
> > codes
> > from SQL executions where applicable seem to be what they should be.
> > Database reads work perfectly, which indicates everything is OK I
> > think (I
> > have a single class with a single method that gets the connection out
> > of
> > the pool and deals with all database access).
> >
> > My question is simple and obvious: anyone have any ideas why database
> > writes would be failing (maybe failing is the wrong word... simply
> > not
> > happening is more accurate) while reads succeed?  It is an Oracle 9.2
> > database by the way, using the Oracle thin JDBC driver (same driver
> > that is
> > used when I switch to manually creating connections in code rather
> > than
> > using JNDI and Tomcat's facilities).
> >
> > Frank W. Zammetti
> > Web Architect Consultant
> >
> >
> >
> >
> >
> > -----------------------------------------
> > The contents of this email are the property of PNC. If it was not
> > addressed to you, you have no legal right to read it. If you think
> > you received it in error, please notify the sender. Do not forward or
> > copy without permission of the sender.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
>__________________________________
>Do you Yahoo!?
>New Yahoo! Photos - easier uploading and sharing.
>http://photos.yahoo.com/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
>
>
>-----------------------------------------
>The contents of this email are the property of PNC. If it was not
>addressed to you, you have no legal right to read it. If you think you
>received it in error, please notify the sender. Do not forward or copy
>without permission of the sender.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


______________________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential. See:
http://www.nextengine.com/confidentiality.php
______________________________________________


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







-----------------------------------------
The contents of this email are the property of PNC. If it was not addressed to you, 
you have no legal right to read it. If you think you received it in error, please 
notify the sender. Do not forward or copy without permission of the sender.


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

Reply via email to