Dear All,
I am using Hibernate2 and Java, MySQL for a project.
But now there will be " net.sf.hibernate.exception.GenericJDBCException:: Unable to perform find" sometimes.
060823.0954 [iZation.TP-Processor6] FATAL There is something wrong in CouponKeysImp: findByCoupon(wcwd01)
net.sf.hibernate.exception.GenericJDBCException: Unable to perform find
In the codes CouponKeysImp(String) is :
public CouponKey findByCoupon(String coupon) throws iZationException{
CouponKey this_couponKey = null;
try {
Session ss = getSession();
Criteria criteria = ss.createCriteria(CouponKey.class);
criteria.add(Expression.like("coupon", coupon));
Iterator<CouponKey> it = criteria.list().iterator();
if (it.hasNext())
this_couponKey = it.next();
return this_couponKey;
}
catch (Throwable e) {
logger.fatal("There is something wrong in CouponKeysImp: findByCoupon("+ coupon + ")");
e.printStackTrace();
throw new iZationException(e);
}
}
The exception is
Caused by: net.sf.hibernate.exception.GenericJDBCException: Unable to perform find
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
Caused by: java.sql.SQLException: No operations allowed after connection closed.
Could anyone me to review the problem? It happens sometimes,maybe once one hour.
Thanks
happybaobao
|