Hi,

i will answer your questions but at first i want to come back to the original
problem:

The problem was that it is (as far as i know) not possible to
get a really fresh connection from castor. My application detected the problem
with the DB connection and tried to get a new/ fresh one. But JDO always 
returned
the connection that procecced the errors.

Now to your questions: 

My application does not keep the connection open. 
I use the following statement to get a DB connection and to close it. 

JDO2.loadConfiguration (jdoConf);
JDO2 jdo = JDO2.createInstance( "sifs2" );
db = jdo.getDatabase();
....
db.close();

thats it.

Reproduction should be easy. 

* Get a DB connection from JDO
* Create object in DB
* Wait 12 hours (do not end app)
* Get again a DB connection
* Try to create => ERROR


The tomcat configuration looks like:
-------------------------------------
   <Resource name="jdbc/SIFS"  auth="Container" type="javax.sql.DataSource"/>

                    <ResourceParams name="jdbc/SIFS">
                        <parameter>
                              <name>url</name>
                              
<value>jdbc:mysql://172.18.25.149:3306/sifs?autoReconnect=true</value>
                            </parameter>
                            
                            <parameter>
                                     <name>username</name>
                                     <value>root</value>
                            </parameter>
                            <parameter>
                                     <name>password</name>
                                     <value>root</value>
                            </parameter>
                            
                            <parameter>
                              <name>factory</name>
                              
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                            </parameter>

                            <parameter>
                              <name>maxActive</name>
                              <value>100</value>
                            </parameter>

                            <parameter>
                              <name>maxIdle</name>
                              <value>10</value>
                            </parameter>
                            
                            <parameter>
                              <name>maxWait</name>
                              <value>20000</value>
                            </parameter>
                            
                            <parameter>
                               <name>driverClassName</name>
                               <value>org.gjt.mm.mysql.Driver</value>
                            </parameter>

                   </ResourceParams>

Castor config:
--------------------------------------------------
<database name="sifs" engine="generic" >
  
  <jndi name="java:comp/env/jdbc/SIFS" />
  
   <mapping href="resources/mapping.xml" />
</database>


-----Ursprüngliche Nachricht-----
Von: Werner Guttmann [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 20. Juni 2005 20:24
An: dev@castor.codehaus.org
Betreff: Re: AW: [castor-dev] JDO / MySQL DB reconnect problem


Hi Carell,

Carell, Michael wrote:
> Hi,
> 
> i really do not know what the MySQL Connector J does.
MySQL Connector/J is a synonym for the JDBC driver for mySQL.
> Fact is that
> the application receives the following exception
> 
> java.io.EOFException
>        at com.mysql.jdbc.MysqlIO.readFully
I actually don't think that mySQL or Castor JDO is the problem. Let me ask you 
a couple of questions:

a) why do you need to keep a connection open for more than 8 hours ?
b) how have you configured your connection pool. In other words, can you please 
show me the tomcat configuration file (assuming that you configured the pool in 
your server.xml file).
> 
> I already configured the Tomcat to use a pooled Datasource and i
> gave a SQL statement to able the database check by tomcat. But
> nothing really helps. If i tried to create an object it failed.
> 
> To get more information someone must debug / dig into the
> Tomcat / ConnectorJ code.
> 
> Thanks for your statement
> Michael Carell
> 
> -----Ursprüngliche Nachricht-----
> Von: Stein M. Hugubakken [mailto:[EMAIL PROTECTED]
> Gesendet: Freitag, 17. Juni 2005 12:24
> An: dev@castor.codehaus.org
> Betreff: Re: [castor-dev] JDO / MySQL DB reconnect problem
> 
> 
> Carell, Michael wrote:
> 
>>Hi again,
>> 
>>perhaps you remember my email from some days before. I have had a
>>problem with the MySQL DB and a timeout on the DB connection.
>> 
>>After some investigations i found the source of the problem. MySQL
>>disconnects idle connections after some time (may be 8 hours).
>> 
> 
> 
> Why have a connection open for 8 hours, shouldn't it be the job for a
> connection-pool to give you an open connection?
> 
> Stein
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 
> 


-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to