Bonjour,
est ce quelqu'un à rencontrer ce problème avec hibernate : Exception d'E/S: End of TNS data channel. Mon programme tourne en permanent et après un temps important d'exécution normale et sans problème cette exception se déclenche.
Je serai reconnaissant pour vos réponses.
MERCI.
Hibernate version: Hibernate 3
Code between sessionFactory.openSession() and session.close():
j'utilise la classe utilitaire pour la récupération de la session et sa fermeture :
public class HibernateUtil {
private static final SessionFactory sessionFactory;
//
public static Log log =
LogFactory.getLog(
ma.meditel.consul.fidelisation.hibernate.util.HibernateUtil.class);
//garde la Session du thread courant dans une variable de type ThreadLocal
public static final ThreadLocal session = new ThreadLocal();
public static boolean CLOSE_SESSION = true;
static {
try {
//mode de fermeture de session
CLOSE_SESSION = true;
// Crée la SessionFactory
sessionFactory =
new Configuration()
.configure("/ma/meditel/consul/fidelisation/ressources/hibernate.cfg.xml")
.buildSessionFactory();
} catch (HibernateException ex) {
log.error("builduing SessionFactory échoué.", ex);
throw ex;
}
}
public static Session currentSession() throws HibernateException {
Session s = (Session) session.get();
// Ouvre une nouvelle Session, si ce Thread n'en a aucune
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}
//Ferme la session
public static void closeSession() throws HibernateException {
Session s = (Session) session.get();
session.set(null);
if (s != null)
s.close();
}
}
Full stack trace of any exception that occurs:
09:09:05,105 WARN JDBCExceptionReporter:71 - SQL Error: 17002, SQLState: null
09:09:05,107 ERROR JDBCExceptionReporter:72 - Exception d'E/S: End of TNS data channel
09:09:05,109 WARN JDBCExceptionReporter:71 - SQL Error: 17002, SQLState: null
09:09:05,111 ERROR JDBCExceptionReporter:72 - Exception d'E/S: End of TNS data channel
09:09:05,113 ERROR AccessService:94 - Erreur lors du chargement de l'accès par msisdn=060414511
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1596)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at ma.meditel.consul.fidelisation.hibernate.services.AccessService.findByMsisdn(AccessService.java:90)
at ma.meditel.consul.fidelisation.web.servlets.AuthentificationServlet.faireLogin(AuthentificationServlet.java:75)
at java.lang.reflect.Method.invoke(Native Method)
at frigo.servlet.ServletPere.service(ServletPere.java:477)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:937)
at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1071)
at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:999)
Caused by:
java.sql.SQLException: Exception d'E/S: End of TNS data channel
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:417)
at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:432)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:182)
at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:165)
at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:604)
at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:485)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:396)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:334)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)
at org.hibernate.loader.Loader.doQuery(Loader.java:390)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
... 13 more
09:09:05,120 ERROR AuthentificationServlet:231 - Erreur lors de l'authentification : org.hibernate.exception.GenericJDBCException: could not execute query
Name and version of the database you are using: Oracle 8i
|