Hi Liz,

Wow, crazy.

Say, “testOnBorrow” could be your friend here. Check out this blog post:

http://tomaszdziurko.pl/2010/06/solving-com-mysql-jdbc-exceptions-jdbc4-communicationsexception-in-spring-jdbc-based-application/

This guy had the same problem. It would work for a while but after an hour or 
so of inactivity it would die…. then the next time he made a call it would be 
ok for a while.

Basically you need two parameters: testOnBorrow=”true” validationQuery=”select 
1″

So every so often MySQL will itself keep the connection “fresh."
AARON ROSENZWEIG / Chat 'n Bike
e:  [email protected]  t:  (301) 956-2319             
        

On Apr 11, 2014, at 1:04 PM, Elizabeth Lynch <[email protected]> wrote:

> I am in the process of setting up a deployment server under CentOS 6.5.
> 
> I have installed MySql server 5.5.36, apache2, Java 1.6 and WebObjects (WO by 
> using Pascal's deployment instructions in the wiki).    
> 
> My WO app starts up via JavaMonitor and runs fine. It connects to the 
> database perfectly, and I can carry out searches, updates, inserts, log in 
> and out, and so on. 
> 
> But if I leave the page alone for a short time (only a couple of minutes) and 
> then attempt to use my Log Out method (which UPDATEs a last-access date 
> field), the app crashes with an sql connection exception like:
> 
> com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression failed: 
> <com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "UPDATE User SET 
> modified = ?, lastAccess = ? WHERE (id = ? AND type = ?)" withBindings: 
> 1:2014-04-11 17:27:52(modified), 2:2014-04-11 17:27:52(lastAccess), 3:2(id), 
> 4:admin"(type)>: Next exception:SQL State:08S01 -- error code: 0 -- msg: 
> Communications link failure The last packet successfully received from the 
> server was 209,780 milliseconds ago. The last packet sent successfully to the 
> server was 8 milliseconds ago.
> 
> 
> My connection URL is:
> 
> URL = 
> "jdbc:mysql://138.213.28.139:3306/dbname?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&capitalizeTypenames=true&useBundledJdbcInfo=true&autoReconnect=true";
>  
> 
> and I'm now using  mysql-connector-java-5.1.30-bin.jar (I was originally on 
> 5.1.13), but that change doesn't seem to have made any difference.
> 
> Googling hasn't shown any obvious fix, although plenty of people seem to 
> encounter this mysql problem.
> 
> Any ideas?  
> 
> Liz
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-deploy mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-deploy/aaron%40chatnbike.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-deploy mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-deploy/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to