Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
I get an ObjectNotFoundException though I can see that hibernate inserts the data into the database... I am using a mysql 5.0 spring 1.2.7 and hibernate 3.1.3
I am pasting a snippet of my log hibernate just says that it can't find the object though the object has been persisted into the database already.
Any help would be highly appreciated
Regards
Subu
006-11-14 00:56:23,968 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:289) - executing flush
2006-11-14 00:56:23,968 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:463) - registering flush begin
2006-11-14 00:56:23,968 DEBUG [main] entity.AbstractEntityPersister (AbstractEntityPersister.java:2034) - Inserting entity: [org.test.test.model.CurrencyCode#EUR]
2006-11-14 00:56:23,968 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:311) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2006-11-14 00:56:23,968 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:346) - insert into CurrencyCodes (created, lastUpdated, Currency_Code) values (?, ?, ?)
2006-11-14 00:56:23,968 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:424) - preparing statement
2006-11-14 00:56:23,968 DEBUG [main] entity.AbstractEntityPersister (AbstractEntityPersister.java:1821) - Dehydrating entity: [org.test.test.model.CurrencyCode#EUR]
2006-11-14 00:56:23,968 DEBUG [main] type.NullableType (NullableType.java:80) - binding '2006-11-14 00:56:23' to parameter: 1
2006-11-14 00:56:23,968 DEBUG [main] type.NullableType (NullableType.java:80) - binding '2006-11-14 00:56:23' to parameter: 2
2006-11-14 00:56:23,968 DEBUG [main] type.NullableType (NullableType.java:80) - binding 'EUR' to parameter: 3
2006-11-14 00:56:23,968 DEBUG [main] jdbc.BatchingBatcher (BatchingBatcher.java:28) - Adding to batch
2006-11-14 00:56:23,968 DEBUG [main] jdbc.BatchingBatcher (BatchingBatcher.java:55) - Executing batch size: 1
2006-11-14 00:56:23,968 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:319) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2006-11-14 00:56:23,968 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:470) - closing statement
2006-11-14 00:56:23,968 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:472) - registering flush end
2006-11-14 00:56:23,968 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:320) - post flush
2006-11-14 00:56:23,968 DEBUG [main] jdbc.JDBCContext (JDBCContext.java:185) - before transaction completion
2006-11-14 00:56:23,968 DEBUG [main] impl.SessionImpl (SessionImpl.java:388) - before transaction completion
2006-11-14 00:56:23,984 DEBUG [main] transaction.JDBCTransaction (JDBCTransaction.java:193) - re-enabling autocommit
2006-11-14 00:56:23,984 DEBUG [main] transaction.JDBCTransaction (JDBCTransaction.java:116) - committed JDBC Connection
2006-11-14 00:56:23,984 DEBUG [main] jdbc.JDBCContext (JDBCContext.java:199) - after transaction completion
2006-11-14 00:56:24,000 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:398) - aggressively releasing JDBC connection
2006-11-14 00:56:24,000 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:435) - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2006-11-14 00:56:24,000 DEBUG [main] impl.SessionImpl (SessionImpl.java:417) - after transaction completion
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:58) - flushing session
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:111) - processing flush-time cascades
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:153) - dirty checking collections
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:170) - Flushing entities and processing referenced collections
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:209) - Processing unreferenced collections
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:223) - Scheduling collection removes/(re)creates/updates
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:85) - Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:91) - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2006-11-14 00:56:24,000 DEBUG [main] pretty.Printer (Printer.java:83) - listing entities:
2006-11-14 00:56:24,000 DEBUG [main] pretty.Printer (Printer.java:90) - org.test.test.model.CurrencyCode{created=2006-11-14 00:56:23, lastUpdated=2006-11-14 00:56:23, currencyCode=EUR}
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:289) - executing flush
2006-11-14 00:56:24,000 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:463) - registering flush begin
2006-11-14 00:56:24,000 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:472) - registering flush end
2006-11-14 00:56:24,000 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:398) - aggressively releasing JDBC connection
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractFlushingEventListener (AbstractFlushingEventListener.java:320) - post flush
2006-11-14 00:56:24,000 DEBUG [main] model.CreditorBeanMapper (CreditorBeanMapper.java:107) - The date is being converted to a dd-mm-yy
2006-11-14 00:56:24,000 DEBUG [main] transaction.JDBCTransaction (JDBCTransaction.java:103) - commit
2006-11-14 00:56:24,000 DEBUG [main] impl.SessionImpl (SessionImpl.java:332) - automatically flushing session
2006-11-14 00:56:24,000 DEBUG [main] jdbc.JDBCContext (JDBCContext.java:185) - before transaction completion
2006-11-14 00:56:24,000 DEBUG [main] impl.SessionImpl (SessionImpl.java:388) - before transaction completion
2006-11-14 00:56:24,000 DEBUG [main] transaction.JDBCTransaction (JDBCTransaction.java:193) - re-enabling autocommit
2006-11-14 00:56:24,000 DEBUG [main] transaction.JDBCTransaction (JDBCTransaction.java:116) - committed JDBC Connection
2006-11-14 00:56:24,000 DEBUG [main] jdbc.JDBCContext (JDBCContext.java:199) - after transaction completion
2006-11-14 00:56:24,000 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:398) - aggressively releasing JDBC connection
2006-11-14 00:56:24,000 DEBUG [main] jdbc.ConnectionManager (ConnectionManager.java:435) - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2006-11-14 00:56:24,000 DEBUG [main] impl.SessionImpl (SessionImpl.java:417) - after transaction completion
2006-11-14 00:56:24,000 DEBUG [main] def.AbstractSaveEventListener (AbstractSaveEventListener.java:462) - transient instance of: org.test.test.model.Creditor
2006-11-14 00:56:24,000 DEBUG [main] def.DefaultMergeEventListener (DefaultMergeEventListener.java:140) - merging transient instance
2006-11-14 00:56:24,000 DEBUG [main] engine.Cascade (Cascade.java:237) - processing cascade ACTION_MERGE for: org.test.test.model.Creditor
2006-11-14 00:56:24,015 DEBUG [main] def.DefaultLoadEventListener (DefaultLoadEventListener.java:153) - loading entity: [org.test.test.model.CurrencyCode#EUR]
2006-11-14 00:56:24,015 DEBUG [main] def.DefaultLoadEventListener (DefaultLoadEventListener.java:304) - attempting to resolve: [org.test.test.model.CurrencyCode#EUR]
2006-11-14 00:56:24,015 DEBUG [main] def.DefaultLoadEventListener (DefaultLoadEventListener.java:340) - object not resolved in any cache: [org.test.test.model.CurrencyCode#EUR]
2006-11-14 00:56:24,015 DEBUG [main] entity.AbstractEntityPersister (AbstractEntityPersister.java:2723) - Fetching entity: [org.test.test.model.CurrencyCode#EUR]
2006-11-14 00:56:24,015 DEBUG [main] loader.Loader (Loader.java:1777) - loading entity: [org.test.test.model.CurrencyCode#EUR]
2006-11-14 00:56:24,015 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:311) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2006-11-14 00:56:24,015 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:346) - select currencyco0_.Currency_Code as Currency1_6_0_, currencyco0_.created as created6_0_, currencyco0_.lastUpdated as lastUpda3_6_0_ from CurrencyCodes currencyco0_ where currencyco0_.Currency_Code=?
2006-11-14 00:56:24,031 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:424) - preparing statement
2006-11-14 00:56:24,031 DEBUG [main] type.NullableType (NullableType.java:80) - binding 'EUR' to parameter: 1
2006-11-14 00:56:24,031 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:327) - about to open ResultSet (open ResultSets: 0, globally: 0)
2006-11-14 00:56:24,031 DEBUG [main] loader.Loader (Loader.java:682) - processing result set
2006-11-14 00:56:24,031 DEBUG [main] loader.Loader (Loader.java:709) - done processing result set (0 rows)
2006-11-14 00:56:24,031 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:334) - about to close ResultSet (open ResultSets: 1, globally: 1)
2006-11-14 00:56:24,031 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:319) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2006-11-14 00:56:24,031 DEBUG [main] jdbc.AbstractBatcher (AbstractBatcher.java:470) - closing statement
2006-11-14 00:56:24,031 DEBUG [main] loader.Loader (Loader.java:839) - total objects hydrated: 0
2006-11-14 00:56:24,031 DEBUG [main] engine.StatefulPersistenceContext (StatefulPersistenceContext.java:748) - initializing non-lazy collections
2006-11-14 00:56:24,031 DEBUG [main] loader.Loader (Loader.java:1808) - done entity load
2006-11-14 00:56:24,031 INFO [main] def.DefaultLoadEventListener (DefaultLoadEventListener.java:95) - Error performing load command
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.test.test.model.CurrencyCode#EUR]
at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:830)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
at org.hibernate.type.EntityType.resolve(EntityType.java:303)
at org.hibernate.type.EntityType.replace(EntityType.java:207)
at org.hibernate.type.AbstractType.replace(AbstractType.java:153)
at org.hibernate.type.TypeFactory.replace(TypeFactory.java:447)
at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:302)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:159)
at org.test.persistence.hibernate.TimestampingMergeEventListener.entityIsTransient(TimestampingMergeEventListener.java:43)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:103)
at org.test.persistence.hibernate.TimestampingMergeEventListener.onMerge(TimestampingMergeEventListener.java:34)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:52)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:672)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:656)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:660)
at org.test.persistence.hibernate.TramadaTransaction.create(TramadaTransaction.java:81)
at org.test.persistence.hibernate.HibernatePersistenceServiceImpl.create(HibernatePersistenceServiceImpl.java:40)
at org.test.test.model.CreditorServiceImpl.saveCreditor(CreditorServiceImpl.java:51)
at org.test.test.model.BatchProcessing.doBulkRead(BatchProcessing.java:131)
at org.test.test.model.BatchProcessing.main(BatchProcessing.java:167)