gloeglm wrote:
Take a look at the generated sql and the bound parameters, Enable logging and check what is actually done.
bound parameters ? I checked the manual, the only reference to bound I found in tomcat implementations. For the time being, I'm testing it stand alone.
Maybe the problem is in the way I try to load the parent and all it's child objects: I do this with the session.find() method., can this be done ?
Below 2 parts of logging: the first shows the loading of a Parent object Derde to which no child objects DerdeRol are connected.
17:53:32,296 DEBUG SessionImpl:3132 - initializing collection [Derde.roles#55]
17:53:32,296 DEBUG BatcherImpl:192 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:53:32,296 DEBUG SQL:223 - select roles0_.rol_id as rol_id__, roles0_.derde_id as derde_id__, roles0_.rol_id as rol_id0_, roles0_.derde_id as derde_id0_, roles0_.toepassingsnummer as toepassi3_0_, roles0_.klassenummer as klassenu4_0_, roles0_.titularis_id as titulari5_0_, roles0_.checkdigit as checkdigit0_, roles0_.password as password0_ from derde_rol roles0_ where roles0_.derde_id=?
Hibernate: select roles0_.rol_id as rol_id__, roles0_.derde_id as derde_id__, roles0_.rol_id as rol_id0_, roles0_.derde_id as derde_id0_, roles0_.toepassingsnummer as toepassi3_0_, roles0_.klassenummer as klassenu4_0_, roles0_.titularis_id as titulari5_0_, roles0_.checkdigit as checkdigit0_, roles0_.password as password0_ from derde_rol roles0_ where roles0_.derde_id=?
17:53:32,296 DEBUG BatcherImpl:227 - preparing statement
17:53:32,343 DEBUG Loader:326 - result set contains (possibly empty) collection: [Derde.roles#55]
17:53:32,343 DEBUG SessionImpl:2902 - uninitialized collection: initializing
17:53:32,343 DEBUG Loader:196 - processing result set
17:53:32,359 DEBUG Loader:225 - done processing result set (0 rows)
17:53:32,359 DEBUG BatcherImpl:199 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:53:32,359 DEBUG BatcherImpl:240 - closing statement
17:53:32,359 DEBUG Loader:238 - total objects hydrated: 0
17:53:32,359 DEBUG SessionImpl:2961 - 1 collections were found in result set
17:53:32,359 DEBUG SessionImpl:2979 - collection fully initialized: [Derde.roles#55]
17:53:32,359 DEBUG SessionImpl:2982 - 1 collections initialized
***********************************************
This is the second part of the logging, for a parent object Derde with ID 38 to which several child objects derderol are connected. The rol_id of the first child object derderol is shown to be vvv, like it is in the dbase.
17:53:32,890 DEBUG SessionImpl:3132 - initializing collection [DerdeRol.erkenningen#DerdeRolCompId@992bae[derde=Derde@3ae941[derdeId=38],rolId=vvv]]
17:53:32,890 DEBUG BatcherImpl:192 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:53:32,890 DEBUG SQL:223 - select erkenninge0_.start_d as start_d__, erkenninge0_.derde_id as derde_id__, erkenninge0_.rol_id as rol_id__, erkenninge0_.start_d as start_d0_, erkenninge0_.derde_id as derde_id0_, erkenninge0_.rol_id as rol_id0_, erkenninge0_.eind_d as eind_d0_, erkenninge0_.timestamp as timestamp0_, erkenninge0_.reden_desactiv as reden_de6_0_ from derde_rol_erk erkenninge0_ where erkenninge0_.derde_id=? and erkenninge0_.rol_id=?
Hibernate: select erkenninge0_.start_d as start_d__, erkenninge0_.derde_id as derde_id__, erkenninge0_.rol_id as rol_id__, erkenninge0_.start_d as start_d0_, erkenninge0_.derde_id as derde_id0_, erkenninge0_.rol_id as rol_id0_, erkenninge0_.eind_d as eind_d0_, erkenninge0_.timestamp as timestamp0_, erkenninge0_.reden_desactiv as reden_de6_0_ from derde_rol_erk erkenninge0_ where erkenninge0_.derde_id=? and erkenninge0_.rol_id=?
17:53:32,890 DEBUG BatcherImpl:227 - preparing statement
17:53:32,968 DEBUG JDBCExceptionReporter:36 - SQL Exception
java.sql.SQLException: ERROR: pg_atoi: error in "vvv": can't parse "vvv"
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
at org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:505)
at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:320)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:48)
at org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1Statement.java:153)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:83)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:794)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:188)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:909)
at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:884)
at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.java:80)
at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:284)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3133)
at net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:331)
at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3007)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:137)
at net.sf.hibernate.loader.Loader.doList(Loader.java:949)
at net.sf.hibernate.loader.Loader.list(Loader.java:940)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:833)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1475)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at be.javasoft.business.model.Derde.fetchAll(Derde.java:254)
at be.javasoft.business.model.Main.main(Main.java:66)
17:53:32,968 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: null
17:53:32,968 ERROR JDBCExceptionReporter:46 - ERROR: pg_atoi: error in "vvv": can't parse "vvv"