Hi,
I'm facing a strange phenomenon:
We're using Hibernate2.0 and a WebSphere Application Server(5.1.1.4) DB2 datasource.
The application starts and runs well.
After executing some app-use-cases hibernate "seems to lose the datasource" (although the datasource-test via the adminconsole verified datsource is working fine) and the following exception occurs:
Code:
Caused by: net.sf.hibernate.HibernateException: Could not find datasource: jdbc/DATASOURCENAME
at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:76
)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:161)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:613)
at dataAccess.base.Connection.createSessionFactory(Connection.java:77)
at dataAccess.base.Connection.createSession(Connection.java:89)
at dataAccess.base.AbstractAccessImpl.loadVoList(AbstractAccessImpl.java:539)
... 14 more
The occurence of the phenomenon is non-determinsitic.
All I definetely know, is, when I stop and restart the application via the adminConsole, I'm not even able to run the application. Then I have to restart the whole WebSphere server to make the datasource available to the application.
Some days already went by without success...hopefully one of you can give me a hint. I think (hope) its a hibernate setting that I'm missing or doing wrong. please have a look at my hibernate.properties:
Code:
hibernate.connection.isolation=4
hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect
hibernate.max_fetch_depth=1
hibernate.jdbc.use_streams_for_binary=true
hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'
hibernate.jdbc.batch_size=20
hibernate.use_outer_join=true
hibernate.connection.datasource=jdbc/DATASOURCENAME
hibernate.show_sql=true
hibernate.jdbc.batch_versioned_data=true
hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
hibernate.connection.pool_size=10
Mapping documents:-not relevant- Mapping correct. App runs accurately on JBoss.
Code between sessionFactory.openSession() and session.close():Code:
session = iConnection.createSession(); //opens the session
tx = session.beginTransaction();
result = finder.find(session, whereString, value, type);
session.flush();
tx.commit();
session.close();
Full stack trace of any exception that occurs:Code:
net.sf.hibernate.HibernateException: Could not find datasource: jdbc/DATASOURCENAME
at net.sf.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:76)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:161)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:613)
at dataAccess.base.Connection.createSessionFactory(Connection.java:77)
at dataAccess.base.Connection.createSession(Connection.java:89)
at dataAccess.base.AbstractAccessImpl.loadVoList(AbstractAccessImpl.java:539)
at components.projekt.dao.ProjektAccessImpl.readAntragstellerByPersonId(ProjektAccessImpl.java:242)
at components.validierung.AntragstellerValidierungDelegate.validate(AntragstellerValidierungDelegate.java:213)
at components.validierung.ValidierungVerwaltungComponent.validate(ValidierungVerwaltungComponent.java:224)
at components.validierung.ValidierungVerwaltungBean.validate(ValidierungVerwaltungBean.java:84)
at components.validierung.EJSRemoteStatelessValidierungVerwaltung_654a66ed.validate(Unknown Source)
at components.validierung._EJSRemoteStatelessValidierungVerwaltung_654a66ed_Tie._invoke(Unknown Source)
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:608)
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:461)
at com.ibm.rmi.iiop.ORB.process(ORB.java:432)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1728)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2227)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:65)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:95)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)
SystemOut O HibernateException Causenull
Name and version of the database you are using:IBM DB2 8.1.4
Debug level Hibernate log excerpt:#####LOG OF ACCURATE APP BEHAVIOUR#####Collection I net.sf.hibernate.mapping.Collection Mapping collection: cs.vo.stammdaten.FlatfileTyp.finanzplanTypListe -> T_FINPLAN_TYP
Collection I net.sf.hibernate.mapping.Collection Mapping collection: cs.vo.projekt.Buchung.mittelgeberReferenzBuchungListe -> T_MG_BUCHUNG
SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl building session factory
Dialect I net.sf.hibernate.dialect.Dialect Using dialect: net.sf.hibernate.dialect.DB2Dialect
NamingHelper I net.sf.hibernate.util.NamingHelper JNDI InitialContext properties:{}
DatasourceCon I net.sf.hibernate.connection.DatasourceConnectionProvider Using datasource: jdbc/DATASOURCENAMESessionFactor I net.sf.hibernate.impl.SessionFactoryImpl Use outer join fetching: true
SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl Use scrollable result sets: true
SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl JDBC 2 max batch size: 20
SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl Transaction strategy: net.sf.hibernate.transaction.JTATransactionFactory
NamingHelper I net.sf.hibernate.util.NamingHelper JNDI InitialContext properties:{}
JTATransactio I net.sf.hibernate.transaction.JTATransactionFactory Locating TransactionManager using: net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
WebSphereTran I net.sf.hibernate.transaction.WebSphereTransactionManagerLookup WebSphere 5.1
JTATransactio I net.sf.hibernate.transaction.JTATransactionFactory TransactionManager lookup successful
SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl echoing all SQL to stdout
SessionFactor I net.sf.hibernate.impl.SessionFactoryObjectFactory no JDNI name configured
SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl Query language substitutions: {no='N', true=1, yes='Y', false=0}[/code]
Configuration I net.sf.hibernate.cfg.Configuration Mapping resource: components/stammdaten/dao/EuCode.hbm.xml
... some mappings...
Collection I net.sf.hibernate.mapping.Collection Mapping class: cs.vo.uam.BenutzerRolle -> T_BENUTZER_ROLLE
Quote:
#####Testing Applications usecases#####
##########time went by##########
######suddenly the following occurs:#####
#####LOG OF FAULTY APP BEHAVIOUR#####Collection I net.sf.hibernate.mapping.Collection Mapping collection: cs.vo.stammdaten.FlatfileTyp.finanzplanTypListe -> T_FINPLAN_TYP
Collection I net.sf.hibernate.mapping.Collection Mapping collection: cs.vo.projekt.Buchung.mittelgeberReferenzBuchungListe -> T_MG_BUCHUNG
SessionFactor I net.sf.hibernate.impl.SessionFactoryImpl building session factory
Dialect I net.sf.hibernate.dialect.Dialect Using dialect: net.sf.hibernate.dialect.DB2Dialect
NamingHelper I net.sf.hibernate.util.NamingHelper JNDI InitialContext properties:{}
net.sf.hibernate.HibernateException: Could not find datasource: jdbc/efREporterDB2It's not that I didn't try to solve it on my own. If I didn't consider this forum to be one of the last chances, I wouldn't post here.
PLEASE, if somebody came across such a problem, or has a clue what's going on...let me know. And let me know, if I kept too much problemcontext on my own.
Big thx in advance for your time
ulli
Quote:
Quote: