[jira] Commented: (JCR-576) Close Connection when I use PersistenManager and FileSystem with mysql database

2006-10-26 Thread JIRA
[ 
http://issues.apache.org/jira/browse/JCR-576?page=comments#action_12445023 ] 

Jorge Rodríguez Pedrianes commented on JCR-576:
---

Close conections occurr when the actual connection are idle about 8 hours (in 
mysql for example) then its dificult that the reconnect occurs in the middle 
transaction (if the first consult is succes, the rest are succes). I think that 
this is'nt the best solution but is a solution, because if I don't check the 
connection, and my application are idle about 8 hours, when i use jacrabbit i 
need restart the application. 

Another solution are detect in supperclass this exception and restart 
connection of jackrabbit and execute the operation again. But now i dont have 
any time to make this :(. 

Thanks

 Close Connection when I use PersistenManager and FileSystem with mysql 
 database
 ---

 Key: JCR-576
 URL: http://issues.apache.org/jira/browse/JCR-576
 Project: Jackrabbit
  Issue Type: Improvement
  Components: core
Affects Versions: 1.0.1, 1.1
 Environment: tomcat  5.5.7
 mysql 5.0
 jackrabbit 1.0.1
Reporter: Jorge Rodríguez Pedrianes
 Attachments: DatabaseFileSystem.java, DatabasePersistenceManager.java


 Hello.
  In this days i was trying to configure jackrabbit with mysql database, 
 but i saw that connections to database were closed when my application was 
 idle about 8 hours. When i try to access to application this threw a 
 exception and i needed to restart tomcat to resolve this problem.  First, I 
 tried to resolve it adding a parameter to url connection 
 (autoReconnect=true), but this solution isn't successfully.
 Then i saw your codes (DatabasePersistenceManager.java and 
 DatabaseFileSystem.java) and i could see the problem: when the connections 
 are closed by the server; the connection (con attribute)  isn't restarted. 
 So, I added a checkConnection Method, this method is add in all methods that 
 need conection: 
 protected void checkConnection() throws FileSystemException {
   if (checkValidConnectionSQL == null) {
   return;
   }
   try {
   checkConnection.executeQuery();
   } catch (SQLException e) {
   log.warn(Restart connection, ErrorCode= \ + 
 e.getErrorCode()+ \);
   initialized = false;
   init();
   e.printStackTrace();
   
   }
 }
 I think that this improvement it's very interesting to avoid restart 
 connections when are necesary
 Thanks:
 Jorge Rodríguez Pedrianes

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (JCR-576) Close Connection when I use PersistenManager and FileSystem with mysql database

2006-09-22 Thread Jukka Zitting (JIRA)
[ 
http://issues.apache.org/jira/browse/JCR-576?page=comments#action_12436819 ] 

Jukka Zitting commented on JCR-576:
---

I would consider such reconnect functionality the task of the JDBC driver. Why 
didn't the MySQL autoReconnect solution work for you?

 Close Connection when I use PersistenManager and FileSystem with mysql 
 database
 ---

 Key: JCR-576
 URL: http://issues.apache.org/jira/browse/JCR-576
 Project: Jackrabbit
  Issue Type: Improvement
Affects Versions: 1.0.1
 Environment: tomcat  5.5.7
 mysql 5.0
 jackrabbit 1.0.1
Reporter: Jorge Rodríguez Pedrianes
 Attachments: DatabaseFileSystem.java, DatabasePersistenceManager.java


 Hello.
  In this days i was trying to configure jackrabbit with mysql database, 
 but i saw that connections to database were closed when my application was 
 idle about 8 hours. When i try to access to application this threw a 
 exception and i needed to restart tomcat to resolve this problem.  First, I 
 tried to resolve it adding a parameter to url connection 
 (autoReconnect=true), but this solution isn't successfully.
 Then i saw your codes (DatabasePersistenceManager.java and 
 DatabaseFileSystem.java) and i could see the problem: when the connections 
 are closed by the server; the connection (con attribute)  isn't restarted. 
 So, I added a checkConnection Method, this method is add in all methods that 
 need conection: 
 protected void checkConnection() throws FileSystemException {
   if (checkValidConnectionSQL == null) {
   return;
   }
   try {
   checkConnection.executeQuery();
   } catch (SQLException e) {
   log.warn(Restart connection, ErrorCode= \ + 
 e.getErrorCode()+ \);
   initialized = false;
   init();
   e.printStackTrace();
   
   }
 }
 I think that this improvement it's very interesting to avoid restart 
 connections when are necesary
 Thanks:
 Jorge Rodríguez Pedrianes

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Commented: (JCR-576) Close Connection when I use PersistenManager and FileSystem with mysql database

2006-09-22 Thread Jukka Zitting (JIRA)
[ 
http://issues.apache.org/jira/browse/JCR-576?page=comments#action_12436821 ] 

Jukka Zitting commented on JCR-576:
---

Hmm, related notice from the MySQL documentation 
(http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-troubleshooting.html):

 Note.  Use of the autoReconnect option is not recommended because there is no 
 safe method of
 reconnecting to the MySQL server without risking some corruption of the 
 connection state or database
 state information. Instead, you should use a connection pool which will 
 enable your application to
 connect to the MySQL server using an available connection from the pool. The 
 autoReconnect facility
 is deprecated, and may be removed in a future release. 

 Close Connection when I use PersistenManager and FileSystem with mysql 
 database
 ---

 Key: JCR-576
 URL: http://issues.apache.org/jira/browse/JCR-576
 Project: Jackrabbit
  Issue Type: Improvement
Affects Versions: 1.0.1
 Environment: tomcat  5.5.7
 mysql 5.0
 jackrabbit 1.0.1
Reporter: Jorge Rodríguez Pedrianes
 Attachments: DatabaseFileSystem.java, DatabasePersistenceManager.java


 Hello.
  In this days i was trying to configure jackrabbit with mysql database, 
 but i saw that connections to database were closed when my application was 
 idle about 8 hours. When i try to access to application this threw a 
 exception and i needed to restart tomcat to resolve this problem.  First, I 
 tried to resolve it adding a parameter to url connection 
 (autoReconnect=true), but this solution isn't successfully.
 Then i saw your codes (DatabasePersistenceManager.java and 
 DatabaseFileSystem.java) and i could see the problem: when the connections 
 are closed by the server; the connection (con attribute)  isn't restarted. 
 So, I added a checkConnection Method, this method is add in all methods that 
 need conection: 
 protected void checkConnection() throws FileSystemException {
   if (checkValidConnectionSQL == null) {
   return;
   }
   try {
   checkConnection.executeQuery();
   } catch (SQLException e) {
   log.warn(Restart connection, ErrorCode= \ + 
 e.getErrorCode()+ \);
   initialized = false;
   init();
   e.printStackTrace();
   
   }
 }
 I think that this improvement it's very interesting to avoid restart 
 connections when are necesary
 Thanks:
 Jorge Rodríguez Pedrianes

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira