-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problems by synchronize Session with Database (Oracle9i)
PostPosted: Mon Jan 10, 2005 9:24 am 
Newbie

Joined: Mon Jan 10, 2005 9:16 am
Posts: 18
Hibernate 2.7.1:

We are trying to use Hibernate in combination with Oracle 9i and the origin driver of Oracle. The Schema generation and the mapping of the Java classes are well done. Cause by trying to commit a Java Object (OO7 Objectmodel) we got the following Error:


[java] Hibernate: select id_sequence.nextval from dual
[java] Hibernate: insert into COMPOSITEPART (type, buildDate, id) values (?, ?, ?)
[java] Hibernate: update ATOMICPART set id=? where id=?
[java] 1923 [2005-01-10 12:21:37,712] ERROR net.sf.hibernate.impl.SessionImpl - Could not synchronize database state with session
[java] 1923 [2005-01-10 12:21:37,712] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - Hibernate exception is thrown.



In another report I found any information that this problem can be caused by the Oracle JDBC driver and can be solved by useing the Bea Oracle driver. Does anyone know more about this problem? Is it really a driver problem?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 10, 2005 11:57 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you must show the full stack trace to get help

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Problems by synchronize Session with Database (Oracle9i)
PostPosted: Mon Jan 10, 2005 12:17 pm 
Newbie

Joined: Mon Jan 10, 2005 9:16 am
Posts: 18
I would like to add any Information about the problem.
We have a one-to-many Relationship between two tables. So we have one object wich has many objects of second object Type. This means that the first object is often altered in one Session. By commiting the Transaction and close the Session we get the following Stack Trace.

Full Stack Trace
[[java] Using configuration junit.extensions.conf.FileConfiguration
[java] Using file D:\Interne Themen\Hibernate\OO7_benchmark\blizzard.conf
[java] .0 [2005-01-10 16:51:39,989] INFO net.sf.hibernate.cfg.Environment - Hibernate 2.1.7
[java] 10 [2005-01-10 16:51:39,999] INFO net.sf.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, hibernate.cglib.use_reflection_optimizer=false, hibernate.cache.provider_class=net.sf.hibernate.cache.EhCacheProvider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.OracleDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.jdbc.batch_size=0, hibernate.proxool.pool_alias=pool1, hibernate.connection.username=scotti, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:oracle:thin:@localhost:1521:Test, hibernate.connection.password=tiger, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
[java] 10 [2005-01-10 16:51:39,999] INFO net.sf.hibernate.cfg.Environment - using java.io streams to persist binary types
[java] 10 [2005-01-10 16:51:39,999] INFO net.sf.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[java] 20 [2005-01-10 16:51:40,009] INFO net.sf.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
[java] 20 [2005-01-10 16:51:40,009] INFO net.sf.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
[java] 371 [2005-01-10 16:51:40,360] INFO net.sf.hibernate.cfg.Configuration - Mapping resource: hibernate.hbm.xml
[java] 511 [2005-01-10 16:51:40,500] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.ModuleImpl -> MODUL
[java] 581 [2005-01-10 16:51:40,570] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.ManualImpl -> MANUAL
[java] 581 [2005-01-10 16:51:40,570] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.AssemblyImpl -> Assembly
[java] 581 [2005-01-10 16:51:40,570] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.ComplexAssemblyImpl -> ComplexAssembly
[java] 581 [2005-01-10 16:51:40,570] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.AtomicPartImpl -> ATOMICPART
[java] 591 [2005-01-10 16:51:40,580] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.DocumentImpl -> DOCUMENT
[java] 601 [2005-01-10 16:51:40,590] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.ConnectionImpl -> CONNECTION
[java] 601 [2005-01-10 16:51:40,590] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.CompositePartImpl -> COMPOSITEPART
[java] 601 [2005-01-10 16:51:40,590] INFO net.sf.hibernate.cfg.Binder - Mapping class: de.tmobile.ebf.blizzard.assembly.BaseAssemblyImpl -> BASEASSEMPLY
[java] 601 [2005-01-10 16:51:40,590] INFO net.sf.hibernate.cfg.Configuration - Configured SessionFactory: null
[java] 601 [2005-01-10 16:51:40,590] INFO net.sf.hibernate.cfg.Configuration - processing one-to-many association mappings
[java] 601 [2005-01-10 16:51:40,590] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.ModuleImpl.assembly -> Assembly
[java] 611 [2005-01-10 16:51:40,600] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.ComplexAssemblyImpl.subAssemblies -> Assembly
[java] 611 [2005-01-10 16:51:40,600] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.AtomicPartImpl.fromConnections -> CONNECTION
[java] 611 [2005-01-10 16:51:40,600] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.AtomicPartImpl.toConnections -> CONNECTION
[java] 611 [2005-01-10 16:51:40,600] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.CompositePartImpl.usedInPriv -> BASEASSEMPLY
[java] 611 [2005-01-10 16:51:40,600] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.CompositePartImpl.usedInShar -> BASEASSEMPLY
[java] 621 [2005-01-10 16:51:40,610] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.CompositePartImpl.parts -> ATOMICPART
[java] 621 [2005-01-10 16:51:40,610] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.BaseAssemblyImpl.componentsPriv -> COMPOSITEPART
[java] 621 [2005-01-10 16:51:40,610] INFO net.sf.hibernate.cfg.Binder - Mapping collection: de.tmobile.ebf.blizzard.assembly.BaseAssemblyImpl.componentsShar -> COMPOSITEPART
[java] 621 [2005-01-10 16:51:40,610] INFO net.sf.hibernate.cfg.Configuration - processing one-to-one association property references
[java] 621 [2005-01-10 16:51:40,610] INFO net.sf.hibernate.cfg.Configuration - processing foreign key constraints
[java] 661 [2005-01-10 16:51:40,650] INFO net.sf.hibernate.dialect.Dialect - Using dialect: net.sf.hibernate.dialect.OracleDialect
[java] 671 [2005-01-10 16:51:40,660] INFO net.sf.hibernate.cfg.SettingsFactory - Maximim outer join fetch depth: 1
[java] 671 [2005-01-10 16:51:40,660] INFO net.sf.hibernate.cfg.SettingsFactory - Use outer join fetching: true
[java] 671 [2005-01-10 16:51:40,660] INFO net.sf.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
[java] 671 [2005-01-10 16:51:40,660] INFO net.sf.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 5
[java] 731 [2005-01-10 16:51:40,720] INFO net.sf.hibernate.connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@localhost:1521:LIDO
[java] 731 [2005-01-10 16:51:40,720] INFO net.sf.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=scotti, password=tiger}
[java] 731 [2005-01-10 16:51:40,720] INFO net.sf.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
[java] 1182 [2005-01-10 16:51:41,171] INFO net.sf.hibernate.cfg.SettingsFactory - Use scrollable result sets: true
[java] 1182 [2005-01-10 16:51:41,171] INFO net.sf.hibernate.cfg.SettingsFactory - Use JDBC3 getGeneratedKeys(): false
[java] 1182 [2005-01-10 16:51:41,171] INFO net.sf.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: false
[java] 1182 [2005-01-10 16:51:41,171] INFO net.sf.hibernate.cfg.SettingsFactory - echoing all SQL to stdout
[java] 1182 [2005-01-10 16:51:41,171] INFO net.sf.hibernate.cfg.SettingsFactory - Query language substitutions: {no='N', true=1, yes='Y', false=0}
[java] 1182 [2005-01-10 16:51:41,171] INFO net.sf.hibernate.cfg.SettingsFactory - cache provider: net.sf.hibernate.cache.EhCacheProvider
[java] 1192 [2005-01-10 16:51:41,181] INFO net.sf.hibernate.cfg.SettingsFactory - query cache factory: net.sf.hibernate.cache.StandardQueryCacheFactory
[java] 1192 [2005-01-10 16:51:41,181] INFO net.sf.hibernate.cfg.Configuration - instantiating and configuring caches
[java] 1292 [2005-01-10 16:51:41,281] INFO net.sf.hibernate.impl.SessionFactoryImpl - building session factory
[java] 1693 [2005-01-10 16:51:41,682] INFO net.sf.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
[java] 1693 [2005-01-10 16:51:41,682] INFO net.sf.hibernate.cache.UpdateTimestampsCache - starting update timestamps cache at region: net.sf.hibernate.cache.UpdateTimestampsCache
[java] 1703 [2005-01-10 16:51:41,692] WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/Interne%20Themen/Hibernate/hibernate-2.1.7c/hibernate-2.1/lib/ehcache-0.9.jar!/ehcache-failsafe.xml
[java] 1723 [2005-01-10 16:51:41,712] WARN net.sf.hibernate.cache.EhCache - Could not find configuration for net.sf.hibernate.cache.UpdateTimestampsCache. Configuring using the defaultCache settings.
[java] 1733 [2005-01-10 16:51:41,722] INFO net.sf.hibernate.cache.StandardQueryCache - starting query cache at region: net.sf.hibernate.cache.StandardQueryCache
[java] 1733 [2005-01-10 16:51:41,722] WARN net.sf.hibernate.cache.EhCache - Could not find configuration for net.sf.hibernate.cache.StandardQueryCache. Configuring using the defaultCache settings.
[java] 1733 [2005-01-10 16:51:41,722] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - sessionFactory=net.sf.hibernate.impl.SessionFactoryImpl@5660d6
[java] 1783 [2005-01-10 16:51:41,772] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - erzeugte Session= net.sf.hibernate.impl.SessionImpl@1049d3
[java] 1783 [2005-01-10 16:51:41,772] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - session=net.sf.hibernate.impl.SessionImpl@15ed659
[java] 1813 [2005-01-10 16:51:41,802] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - session=net.sf.hibernate.impl.SessionImpl@15ed659
[java] 1813 [2005-01-10 16:51:41,802] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - session=net.sf.hibernate.impl.SessionImpl@15ed659
[java] Hibernate: select id_sequence.nextval from dual
[java] Hibernate: insert into MODUL (type, buildDate, id) values (?, ?, ?)
[java] Hibernate: update Assembly set module_id=? where id=?
[java] 1993 [2005-01-10 16:51:41,982] ERROR net.sf.hibernate.impl.SessionImpl - Could not synchronize database state with session
[java] 1993 [2005-01-10 16:51:41,982] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - Hibernate exception is thrown.
[java] 1993 [2005-01-10 16:51:41,982] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - session=net.sf.hibernate.impl.SessionImpl@15ed659
[java] 2003 [2005-01-10 16:51:41,992] INFO de.tmobile.ebf.blizzard.util.PerformanceMeasurement - Duration stop for TC_INITDB 220 ms elapsed
[java] 2003 [2005-01-10 16:51:41,992] INFO de.tmobile.ebf.blizzard.client.BlizzardClient - session=net.sf.hibernate.impl.SessionImpl@15ed659
[java] Time: 2,043


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 10, 2005 12:36 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
emmanuel wrote:
you must show the full stack trace to get help


By trace, we mean the stack trace, not just the error message.
Code:
}
catch (Exception ex) {
  log.error(ex.getMessage(), ex);
  ex.printStackTrace()
}


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 11, 2005 4:59 am 
Newbie

Joined: Mon Jan 10, 2005 9:16 am
Posts: 18
I have fixed the problem. I have used for a one to many Relationship the id (not null) as Key column. Then a foreign key exception is occured.

After inserting the "inverse"
Tag, the problem was solved.

<set name="componentsShar" inverse="true">
<key column="id" />
<one-to-many class="CompositePartImpl"/>
</set>

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.