Foros del Web » Programación para mayores de 30 ;) » Java »

Problemas Hibernate

Estas en el tema de Problemas Hibernate en el foro de Java en Foros del Web. Hola amigos, me inscribi aqui porque estoy desesperado. Recibí una aplicación hecha en Java + Hibernate que corre en JBoss y BD Oracle. Tengo un ...
  #1 (permalink)  
Antiguo 28/02/2012, 06:32
 
Fecha de Ingreso: febrero-2012
Mensajes: 1
Antigüedad: 12 años, 1 mes
Puntos: 0
Problemas Hibernate

Hola amigos, me inscribi aqui porque estoy desesperado. Recibí una aplicación hecha en Java + Hibernate que corre en JBoss y BD Oracle.
Tengo un problema al leer un registro en una tabla relacionado a las clave primaria de esta.
La tabla la creo a mano usando un script sql, y aquí empiezan mis problemas.
El select en la aplicación arroja un resulset vacío en estos casos:
Si creo la tabla sin PK y luego hago un insert.
Si creo la tabla con PK y luego hago un insert.

En cambio, si creo la tabla sin PK, luego hago el insert y despues hago el alter y agrego la PK, EL SELECT FUNCIONA, pero los registros que agrego después, tampoco los lee, como en los casos anteriores.
Yo no entiendo mucho sobre la configuración de esta herramienta. Alguien puede guiarme un poco?

Estos son los log:

____________________________Log cuando NO lee_________________________
2012-02-27 17:44:02,184 INFO [STDOUT] +++ Aqui comienza la lectura del usuario +++
2012-02-27 17:44:02,184 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 13303754421
2012-02-27 17:44:02,184 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
2012-02-27 17:44:02,184 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
2012-02-27 17:44:02,184 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
2012-02-27 17:44:02,184 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
2012-02-27 17:44:02,184 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2012-02-27 17:44:02,184 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
2012-02-27 17:44:02,185 DEBUG [org.hibernate.SQL] select usercertmo0_.usercm as usercm3583_, usercertmo0_.pass as pass3583_ from USER_CERTMOVIL usercertmo0_ where usercertmo0_.usercm=?
2012-02-27 17:44:02,185 DEBUG [org.hibernate.loader.hql.QueryLoader] bindNamedParameters() servmovil2 -> usuario [1]
2012-02-27 17:44:02,186 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
2012-02-27 17:44:02,186 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close ResultSet (open ResultSets: 1, globally: 1)
2012-02-27 17:44:02,186 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2012-02-27 17:44:02,186 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
2012-02-27 17:44:02,186 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2012-02-27 17:44:02,186 DEBUG [org.hibernate.engine.StatefulPersistenceContext] initializing non-lazy collections
2012-02-27 17:44:02,186 INFO [STDOUT] +++ Aqui termina la lectura del usuario +++

____________________________Log cuando SI lee_________________________
2012-02-27 17:45:08,294 INFO [STDOUT] +++ Aqui comienza la lectura del usuario +++
2012-02-27 17:45:08,294 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 13303755082
2012-02-27 17:45:08,294 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
2012-02-27 17:45:08,294 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
2012-02-27 17:45:08,294 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
2012-02-27 17:45:08,294 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Transaction already joined
2012-02-27 17:45:08,294 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2012-02-27 17:45:08,294 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
2012-02-27 17:45:08,294 DEBUG [org.hibernate.SQL] select usercertmo0_.usercm as usercm3583_, usercertmo0_.pass as pass3583_ from USER_CERTMOVIL usercertmo0_ where usercertmo0_.usercm=?
2012-02-27 17:45:08,294 DEBUG [org.hibernate.loader.hql.QueryLoader] bindNamedParameters() servmovil -> usuario [1]
2012-02-27 17:45:08,296 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open ResultSet (open ResultSets: 0, globally: 0)
2012-02-27 17:45:08,296 DEBUG [org.hibernate.loader.Loader] result row: EntityKey[cl.bluecompany.bligoo.par.UserCertMovilEB#servmovi l]
2012-02-27 17:45:08,296 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close ResultSet (open ResultSets: 1, globally: 1)
2012-02-27 17:45:08,296 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2012-02-27 17:45:08,296 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
2012-02-27 17:45:08,296 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2012-02-27 17:45:08,296 DEBUG [org.hibernate.engine.TwoPhaseLoad] resolving associations for [cl.bluecompany.bligoo.par.UserCertMovilEB#servmovi l]
2012-02-27 17:45:08,296 DEBUG [org.hibernate.engine.TwoPhaseLoad] done materializing entity [cl.bluecompany.bligoo.par.UserCertMovilEB#servmovi l]
2012-02-27 17:45:08,296 DEBUG [org.hibernate.engine.StatefulPersistenceContext] initializing non-lazy collections
2012-02-27 17:45:08,296 INFO [STDOUT] +++ Aqui termina la lectura del usuario +++



Muchas gracias.

Etiquetas: hibernate
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:21.