-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Problem with Oracle and.. loader?
PostPosted: Fri Jan 04, 2008 9:39 am 
Newbie

Joined: Fri Jan 04, 2008 9:29 am
Posts: 2
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 11, 2008 5:53 am 
Newbie

Joined: Mon Sep 24, 2007 2:55 pm
Posts: 13
Of which type is column AppUser.loginId?
Char(x)?

Char columns with a fixed length require that the parameter used for the query to be filled up with blanks up to the required column length.
Otherwise you'll not find the row.

Better use varchar2(x) as column type if possible.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 14, 2008 3:48 am 
Newbie

Joined: Fri Jan 04, 2008 9:29 am
Posts: 2
AppUser.loginId is VARCHAR2(24).
We don't know where the problem is.. Hibernate? Oracle?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.