Hi,
I want to check at the beginning of my program if the database is available. Has somebody an idea how I can check this?
Carina
I"m using:
Hibernate version: 3.2 beta 8
Name and version of the database you are using: Oracle 10g
Full stack trace of any exception that occurs:
Code:
2007-07-09 10:33:30,264 INFO [org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:41)] Using Hibernate built-in connection pool (not for production use!)
2007-07-09 10:33:30,270 INFO [org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:42)] Hibernate connection pool size: 20
2007-07-09 10:33:30,270 INFO [org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:45)] autocommit mode: false
2007-07-09 10:33:30,307 INFO [org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:80)] using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@bio-ora:1521:chemdb02
2007-07-09 10:33:30,307 INFO [org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:86)] connection properties: {user=csr, password=****}
2007-07-09 10:33:30,754 WARN [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:117)] Could not obtain connection metadata
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
bio-ora:1521:chemdb02
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
at de.fhg.scai.bio.csr.io.database.communication.HibernateUtil.<clinit>(HibernateUtil.java:16)
at de.fhg.scai.bio.csr.workflows.Workflow.run(Workflow.java:386)
at de.fhg.scai.bio.csr.workflows.Workflow.main(Workflow.java:1681)
2007-07-09 10:33:30,831 INFO [org.hibernate.dialect.Dialect.<init>(Dialect.java:152)] Using dialect: org.hibernate.dialect.Oracle9Dialect
2007-07-09 10:33:30,850 INFO [org.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:31)] Using default transaction strategy (direct JDBC transactions)
2007-07-09 10:33:30,853 INFO [org.hibernate.transaction.TransactionManagerLookupFactory.getTransactionManagerLookup(TransactionManagerLookupFactory.java:33)] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2007-07-09 10:33:30,854 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:143)] Automatic flush during beforeCompletion(): disabled
2007-07-09 10:33:30,854 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:147)] Automatic session close at end of transaction: disabled
2007-07-09 10:33:30,860 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:162)] Scrollable result sets: disabled
2007-07-09 10:33:30,861 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:170)] JDBC3 getGeneratedKeys(): disabled
2007-07-09 10:33:30,861 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:178)] Connection release mode: auto
2007-07-09 10:33:30,874 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:196)] Default schema: CSR
2007-07-09 10:33:30,875 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:205)] Default batch fetch size: 1
2007-07-09 10:33:30,875 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:209)] Generate SQL with comments: disabled
2007-07-09 10:33:30,875 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:213)] Order SQL updates by primary key: disabled
2007-07-09 10:33:30,875 INFO [org.hibernate.cfg.SettingsFactory.createQueryTranslatorFactory(SettingsFactory.java:382)] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2007-07-09 10:33:30,878 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory.<init>(ASTQueryTranslatorFactory.java:24)] Using ASTQueryTranslatorFactory
2007-07-09 10:33:30,879 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:221)] Query language substitutions: {}
2007-07-09 10:33:30,879 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:226)] JPA-QL strict compliance: disabled
2007-07-09 10:33:30,879 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:231)] Second-level cache: enabled
2007-07-09 10:33:30,880 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:235)] Query cache: disabled
2007-07-09 10:33:30,880 INFO [org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:369)] Cache provider: org.hibernate.cache.NoCacheProvider
2007-07-09 10:33:30,880 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:250)] Optimize cache for minimal puts: disabled
2007-07-09 10:33:30,880 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:259)] Structured second-level cache entries: disabled
2007-07-09 10:33:30,904 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:286)] Statistics: disabled
2007-07-09 10:33:30,904 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:290)] Deleted entity synthetic identifier rollback: disabled
2007-07-09 10:33:30,905 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:305)] Default entity-mode: pojo
2007-07-09 10:33:30,905 INFO [org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:309)] Named query checking : enabled
2007-07-09 10:33:30,981 INFO [org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:161)] building session factory
2007-07-09 10:33:33,077 INFO [org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:82)] Not binding factory to JNDI, no JNDI name configured
2007-07-09 10:33:33,156 WARN [org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:77)] SQL Error: 0, SQLState: null
2007-07-09 10:33:33,156 ERROR [org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:78)] Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
bio-ora:1521:chemdb02