Hi all,
We have a problem using our application EJB3 against Oracle DB. The same application works fine against MySQL.
We need some light where the problem is.
Next I show the debug output in both cases.
We tried different jdbc drivers from Oracle, but no success.
with oracle.. fail
-----------------------------------------------
Code:
INFO [org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider] Using provided datasource
INFO [org.hibernate.cfg.SettingsFactory] RDBMS: Oracle, version: Oracle9i Release 9.2.0.3.0 - Production JServer Release 9.2.0.3.0 - Production
INFO [org.hibernate.cfg.SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.2.0.3.0
INFO [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.Oracle9Dialect
---
DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
DEBUG [org.hibernate.SQL] select appuser0_.id as id27_, appuser0_.fullName as fullName27_, appuser0_.loginId as loginId27_, appuser0_.profile as profile27_, appuser0_.email as email27_, appuser0_.locked as locked27_, appuser0_.lockedReason as lockedRe7_27_ from AppUser appuser0_ where appuser0_.loginId=?
DEBUG [org.hibernate.loader.hql.QueryLoader] bindNamedParameters() YOYO -> LOGINID [1]
DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
DEBUG [org.hibernate.engine.StatefulPersistenceContext] initializing non-lazy collections
ERROR [STDERR] javax.persistence.NoResultException: No entity found for query
ERROR [STDERR] at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:82)
with MySQL.. fine
-----------------------------------------------
Code:
INFO [org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider] Using provided datasource
INFO [org.hibernate.cfg.SettingsFactory] RDBMS: MySQL, version: 4.1.12
INFO [org.hibernate.cfg.SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
INFO [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
----------
DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
DEBUG [org.hibernate.SQL] select appuser0_.id as id27_, appuser0_.fullName as fullName27_, appuser0_.loginId as loginId27_, appuser0_.profile as profile27_, appuser0_.email as email27_, appuser0_.locked as locked27_, appuser0_.lockedReason as lockedRe7_27_ from AppUser appuser0_ where appuser0_.loginId=?
DEBUG [org.hibernate.loader.hql.QueryLoader] bindNamedParameters() YOYO -> LOGINID [1]
DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG [org.hibernate.loader.Loader] result row: EntityKey[com.paquete.gec.ejb.model.AppUser#1]
DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close ResultSet (open ResultSets: 1, globally: 1)
DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
DEBUG [org.hibernate.engine.TwoPhaseLoad] resolving associations for [com.paquete.gec.ejb.model.AppUser#1]
DEBUG [org.hibernate.engine.TwoPhaseLoad] done materializing entity [com.paquete.gec.ejb.model.AppUser#1]
DEBUG [org.hibernate.engine.StatefulPersistenceContext] initializing non-lazy collections
DEBUG [org.hibernate.loader.Loader] loading collection: [com.paquete.gec.ejb.model.AppUser.authorizationInformation#1]2
Can you help us?
Agustin
PD: Sorry my bad english, my natural language is spanish; but i hope transmit the idea correctly.