You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by 松田 慎太郎 <sh...@yahoo.co.jp> on 2005/10/13 09:58:32 UTC

Thread Pool and Connection Pool

We are having a problem with Cocoon in managing threads
and connection groups.
Any advice would be very helpful.

Here is our environment.

  OS : Solaris 9
  AP :Java 1.4.2_08 + Tomcat 5.0.28 + Cocoon 2.1.7
  DB :Oracle 9i (RAC)


Below is the flow of the database access in the Web
Application we are currently developing.

 -get DB connection using DataSourceComponent
 -set the connection to ThreadLocal
 -get connection from ThreadLocal
 -if the transaction is necessary, execute
setAutoCommit(false)

When above is run, we get very strange exceptions.

  Pattern 1:
    In a single transaction, a record is first inserted to
a parent table,
    then using the ID obtained from the first insertion,
insert anothere
    record to the child table. As the second insertion is
executed, 
    ORA-02291 error occurs.

  Pattern 2:
    Though record lock is done using FOR UPDATE, inserting
and updating
    CLOB/BLOB fields fail with ORA-22990 error.

Since other database activities have no problems, we don't
think the 
problem is with JDBC settings.

We think errors are occuring:
  -because the connection is held in ThreadLocal
  -because Cocoon's Thread Pool setting is set to be
reused 

We comfirmed that the errors don't occur when the
connections are held
as local instance instead of ThreadLocal, but we cannot
figure out WHY.

If anyone has had the same issue or knows the way around
it, please let
us know.

The runnable-manager settings in cocoon.xconf are the
default settings.

 <runnable-manager logger="core.runnable">
   
<thread-factory>org.apache.cocoon.components.thread.DefaultThreadFactory</thread-factory>
    <thread-pools>
      <thread-pool>
        <name>default</name>
        <priority>NORM</priority>
        <daemon>false</daemon>
        <queue-size>-1</queue-size>
        <max-pool-size>5</max-pool-size>
        <min-pool-size>5</min-pool-size>
        <keep-alive-time-ms>60000</keep-alive-time-ms>
        <block-policy>RUN</block-policy>
        <shutdown-graceful>false</shutdown-graceful>
        <shutdown-wait-time-ms>-1</shutdown-wait-time-ms>
      </thread-pool>
      <thread-pool>
        <name>daemon</name>
        <priority>NORM</priority>
        <daemon>true</daemon>
        <queue-size>0</queue-size>
        <max-pool-size>-1</max-pool-size>
        <min-pool-size>1</min-pool-size>
        <keep-alive-time-ms>60000</keep-alive-time-ms>
        <block-policy>ABORT</block-policy>
        <shutdown-graceful>false</shutdown-graceful>
        <shutdown-wait-time-ms>-1</shutdown-wait-time-ms>
      </thread-pool>
    </thread-pools>
 </runnable-manager>

--------------------------------------
Know more about Breast Cancer
http://pr.mail.yahoo.co.jp/pinkribbon/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org