java - No operations allowed after connection closed.Connection was implicitly closed by the driver. C3P0 -


i trying upload images(one one) using c3p0 connection pooling jdbc type 4 driver(connecting mysql) keeps on closing connection. have seen maximum timeout in configuration of mysql set 300 seconds. here how persistence xml uses c3p0.

<bean id="datasource" class="com.mchange.v2.c3p0.combopooleddatasource"     scope="singleton" destroy-method="close">     <property name="driverclass" value="...." />     <property name="jdbcurl" value="...." />     <property name="user" value="....." />     <property name="password" value="...." />     <property name="initialpoolsize" value="10" />     <property name="minpoolsize" value="5" />     <property name="maxpoolsize" value="20" />     <property name="maxidletime" value="5" />     <property name="autocommitonclose" value="false" /> </bean> 

can explain causing driver implicitly close connection. also, how can reolve issue?

here error message get:

19:01:45,504  warn newpooledconnection:486 - [c3p0] pooledconnection has signalled connection error still in use!  19:01:45,505  warn newpooledconnection:487 - [c3p0] error has occurred [   com.mysql.jdbc.exceptions.jdbc4.mysqlnontransientconnectionexception: no operations allowed after connection closed.connection implicitly closed driver. ] not reported listeners!  com.mysql.jdbc.exceptions.jdbc4.mysqlnontransientconnectionexception: no operations allowed after connection closed.connection implicitly closed driver. 

can change to

<property name="maxidletime" value="0" />  //0 = never expire 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -