[Hibernate-JIRA] Created: (HSEARCH-124) Double lucene document created when inserting entities (@IndexEmbedded)
by Amin Mohammed-Coleman (JIRA)
Double lucene document created when inserting entities (@IndexEmbedded)
-----------------------------------------------------------------------
Key: HSEARCH-124
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-124
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.0.0.cr1
Environment: Hibernate version: 3.2.5.ga
Database platform: MySQL
OS: Mac OS 10.4.10
Spring Framework 2.0
Reporter: Amin Mohammed-Coleman
Attachments: phone-app.zip
When inserting an entity using hibernate, double lucene documents are created for entities associated with the original entity. Please refer to :
http://forum.hibernate.org/viewtopic.php?t=980102
For example the below code used to populate/create a Contact entity produces two lucene documents for Address and Phone entities. The database has only entry for the Address and Phone.
[code]
Address address = new Address();
address.setAddress1("TEST1");
address.setAddress2("N/A");
address.setTown("TEST TOWN");
address.setCounty("TEST COUNTY");
address.setCountry("UK");
address.setPostcode("XXXXXXX");
address.setActive(true);
address.setCreatedOn(new Date());
address.setLastUpdatedOn(new Date());
Phone phone = new Phone();
phone.setNumber("01273234122");
phone.setType("HOME");
phone.setCreatedOn(new Date());
phone.setLastUpdatedOn(new Date());
PersonalContact contact = new PersonalContact();
contact.setFirstname("Amin");
contact.setSurname("Mohammed-Coleman");
contact.setEmail("address(a)hotmail.com");
contact.setDateOfBirth(new Date());
contact.setNotifyBirthDay(false);
contact.setCreatedOn(new Date());
contact.setLastUpdatedOn(new Date());
contact.setNotes("TEST");
contact.addAddressToContact(address);
contact.addPhoneToContact(phone);
ApplicationContext appCtx = new ClassPathXmlApplicationContext(new String[]{"/spring/context-dao.xml"});
ContactDao contactDao = (ContactDao)appCtx.getBean("contactDao");
contactDao.createContact(contact);
List<Contact> contacts = contactDao.search("address(a)hotmail.com");
System.out.println("contacts = " + contacts);
[/code]
Please find attached the entities I am using. I am not sure if there is enough information but the post provides all the information.
Thanks
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 12 months
[Hibernate-JIRA] Created: (EJB-285) EJB3 compliant default settings override hibernate.cfg.xml
by Rodolfo Federico Gamarra (JIRA)
EJB3 compliant default settings override hibernate.cfg.xml
----------------------------------------------------------
Key: EJB-285
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-285
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.1.GA
Environment: Hibernate 3.2.1
Hibernate EntityManager 3.3.1.GA
Reporter: Rodolfo Federico Gamarra
Priority: Minor
Attachments: entitymanager-configuration.zip
Hi, I think I've found a little bug in org.hibernate.ejb.Ejb3Configuration ($Id: Ejb3Configuration.java 11344 2007-03-25 18:24:01Z epbernard $) class.
Hopefully the title is clear enough to describe what's happening:
- I've a persitence.xml which references (via "hibernate.ejb.cfgfile") a hibernate.cfg.xml, in the way that's described, for example, in the Entity Manager User Guide (Version: 3.3.1.GA. Page 8, below "Here is a typical configuration in a J2SE environment").
- In the referenced xml I set the auto commmit property in false and in persistence.xml nothing it's said about that property.
- What I see at the end of the startup is that the value is true.
Posible explanation:
- Take a look at Ejb3Configuration, specially the methods:
- configure(Properties properties, Map workingVars)
- prepareProperties(Properties properties, Map workingVars)
- A pseudo-code for the first may be:
1) Prepare properties (load persistence.xml):
//settings that always apply to a compliant EJB3
preparedProperties.setProperty( Environment.AUTOCOMMIT, "true" );
2) Load the referenced "hibernate.ejb.cfgfile".
I saw in debugging that the actual false value gets loaded.
3) Priorize persistence.xml over hibernate.cfg.xml:
cfg.addProperties( preparedProperties ); //persistence.xml has priority over hibernate.Cfg.xml
The problem with the last line (besides the typo in the comment, in the extension :-)) is that, I think, that priorization doesn't consider that maybe the values in the prepared properties are there because a default (and not because they were acctually configured in the xml).
After reading "READ THIS BEFORE USING JIRA!", I took a look in the already reported things but didn't get to the problem (In fact, I was using an older verion and, so, I made an update and tried with the lattest one). Also, as you say "Don't attach your project folder as a Zip file, but only the relevant files. Please don't upload them one-by-one, but packaged in a Zip": I made a dummy project (Eclipse 3.2) which shows the problem. I setup log4j properties into debug mode, where the beforementioned can be saw. Also I added some reflection code in order to see the configuration values after the startup process has finished. I also used some other properties in order to have some combinations: a property defined in both xmls (persistence wins), just in persistence, just in hibernate and gets overrided (autocommit), just in hibernate but doesn't get overrided (user name). I hope that I didn't misundertood "...don't attach your project...", what I attached is a tiny-example-oriented project; from which the relevant files are "persistence.xml" and "hibernate.cfg.xml".
In the heading of the log (which is in root of the project in console.txt) you can see the versions of Hibernate, in particular Hibernate EntityManager 3.3.1.GA.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 12 months
[Hibernate-JIRA] Created: (HHH-2677) Not loading the ORM.xml file
by Adi (JIRA)
Not loading the ORM.xml file
----------------------------
Key: HHH-2677
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2677
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.0.ga
Environment: Windows XP,MySQL5.0,Hibernate3.2.0
Reporter: Adi
Priority: Minor
Attachments: persistence.zip
IF the name of the orm.xml is anything different, then Hibernate is not loading the orm file.
Following is the error I am getting:
java.lang.ExceptionInInitializerError
at com.iChieve.domain.entity.ProductCategoryUnitTest.testSave(ProductCategoryUnitTest.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: simpleJPA-PersistenceUnit] Unable to find XML mapping file in classpath: /META-INF/myorm.xml
at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:914)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:772)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:183)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:240)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at com.iChieve.dao.EntityManagerHelper.<clinit>(EntityManagerHelper.java:20)
... 17 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 12 months
[Hibernate-JIRA] Created: (EJB-283) Ejb3Configuration can't read Jar file OC4J
by Roman Legat (JIRA)
Ejb3Configuration can't read Jar file OC4J
-------------------------------------------
Key: EJB-283
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-283
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.1.GA
Environment: EM 3.3.1.GA,
Core 3.2.0 GA
Reporter: Roman Legat
Priority: Minor
The "Find-the-entities-yourself"-Feature doesn't work with OC4J, since walking over the jar fails.
This is similar to #174, but the problem is not in JarVisitor, but in
org.jboss.util.file.ArchiveBrowser.getBrowser:
When deploying to OC4J, the Jar URLs start with "code-source" instead of "file"
(See PU root URL below for example).
Hence the Archive-Browser throws a RuntimeException.
Solution should be similar as in #174.
2007-04-01 22:13:38,390 DEBUG Ejb3Configuration - Processing PersistenceUnitInfo [
name: MyService
persistence provider classname: org.hibernate.ejb.HibernatePersistence
classloader: mis_client.web.mis_client:0.0.0
Temporary classloader: org.springframework.instrument.classloading.SimpleThrowawayClassLoader@106ef07
excludeUnlistedClasses: false
JTA datasource: null
Non JTA datasource: org.springframework.jdbc.datasource.DriverManagerDataSource@36eb76
Transaction type: RESOURCE_LOCAL
PU root URL: code-source:/C:/Programs/dev/oracle/jdev-10132/j2ee/home/applications/mis_client/mis_client/WEB-INF/lib/mis_model.jar!/
Jar files URLs []
Managed classes names []
Mapping files names []
Properties []
java.lang.RuntimeException: error trying to scan <jar-file>: code-source:/C:/Programs/dev/oracle/jdev-10132/j2ee/home/applications/mis_client/mis_client/WEB-INF/lib/mis_model.jar!/
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:635)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:350)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
...
Caused by: java.lang.RuntimeException: Archive browser cannot handle protocol: code-source:/C:/Programs/dev/oracle/jdev-10132/j2ee/home/applications/mis_client/mis_client/WEB-INF/lib/mis_model.jar!/
at org.jboss.util.file.ArchiveBrowser.getBrowser(ArchiveBrowser.java:93)
Regards,
Roman
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 12 months
[Hibernate-JIRA] Created: (HHH-2293) HQL Query with fetch causes exception if no rows selected be query (java.sql.SQLException: Exhausted Resultset )
by Andriy Solonchuk (JIRA)
HQL Query with fetch causes exception if no rows selected be query (java.sql.SQLException: Exhausted Resultset )
----------------------------------------------------------------------------------------------------------------
Key: HHH-2293
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2293
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.2
Environment: Oracle 10g2 (10.2.0.2.0) Hiberbate 3.2.0
Reporter: Andriy Solonchuk
After executing next query
select p from ProductHibernate p left join FETCH p.productSomeCollection
where 1=2 /* that will cause NO rows returned*/
we will have exception
org.hibernate.exception.GenericJDBCException: could not perform sequential read of results (forward)
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
...
Caused by: java.sql.SQLException: Exhausted Resultset
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
...
at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:375)
... 24 more
If we will review code of Loader.java class we can see next
if ( resultSet.isAfterLast() ) {
// don't even bother trying to read further
return null;
}
if ( resultSet.isBeforeFirst() ) {
resultSet.next();
}
So at this step there are no checking if resultSet has any rows...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years
[Hibernate-JIRA] Created: (ANN-622) TableGenerator is considered when @Id is defined in MappedSuperclass
by Chandra (JIRA)
TableGenerator is considered when @Id is defined in MappedSuperclass
---------------------------------------------------------------------
Key: ANN-622
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-622
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.3.0.ga
Environment: Hibernate Core 3.2.4.sp1
Hibernate Annotations 3.3.0.GA
hibernate-entitymanager-3.3.1.GA
Reporter: Chandra
Attachments: Cat.java, cat.xml, IdTest.java
We have id defined in a MappedSuperclass (Base) and derrived entity class (Cat). We specify table-generator in an xml file (cat.xml) and use attribute override for ID column. testMappedSuperClassWithTableGenerator in org.hibernate.test.annotations.id.IdTest class fails. If we inline mapped super class with Entity then the test cases succeeds.
With attached debugger we noticed that the TableGenerator is attached to in the begining when the class is in the process of mapping. However, at later point it get overridden by org.hibernate.id.Assigned.
The output with oracle db is,
17:43:51,651 INFO Version:118 - Hibernate Annotations 3.3.0.GA
17:43:51,682 INFO Environment:118 - Hibernate 3.2.4.sp1
17:43:51,697 INFO Environment:118 - hibernate.properties not found
17:43:51,697 INFO Environment:118 - Bytecode provider name : cglib
17:43:51,713 INFO Environment:118 - using JDK 1.4 java.sql.Timestamp handling
17:43:51,869 INFO Version:118 - Hibernate EntityManager 3.3.1.GA
17:43:51,916 DEBUG Ejb3Configuration:97 - Look up for persistence unit: vet
17:43:51,916 DEBUG Ejb3Configuration:76 - Analyse of persistence.xml: file:/C:/projects/sample/target/classes/META-INF/persistence.xml
17:43:52,963 DEBUG DTDEntityResolver:97 - trying to resolve system-id [file:/C:/projects/sample/target/classes/META-INF/xsd/persistence_1_0.xsd]
17:43:52,963 DEBUG EJB3DTDEntityResolver:97 - recognized EJB3 ORM namespace; attempting to resolve on classpath under org/hibernate/ejb
17:43:52,963 DEBUG EJB3DTDEntityResolver:97 - located [file:/C:/projects/sample/target/classes/META-INF/xsd/persistence_1_0.xsd] in classpath
17:43:53,119 DEBUG DTDEntityResolver:97 - trying to resolve system-id [file:/C:/projects/sample/target/classes/META-INF/vets-persistence.xml]
17:43:53,182 DEBUG DTDEntityResolver:97 - trying to resolve system-id [file:/C:/projects/sample/target/classes/META-INF/content-api-persistence.xml]
17:43:53,244 DEBUG PersistenceXmlLoader:76 - Persistent Unit name from persistence.xml: vet
17:43:53,323 DEBUG PersistenceXmlLoader:76 - Persistent Unit name from persistence.xml: content
17:43:53,323 DEBUG Ejb3Configuration:76 - PersistenceMetadata [
name: vet
jtaDataSource: null
nonJtaDataSource: null
transactionType: RESOURCE_LOCAL
provider: null
classes[
org.hibernate.test.annotations.id.Cat ]
packages[
]
mappingFiles[
META-INF/cat.xml
]
jarFiles[
]
hbmfiles: 0
properties[
hibernate.cache.use_query_cache]: false
hibernate.connection.driver_class: oracle.jdbc.driver.OracleDriver
hibernate.dialect: org.hibernate.dialect.Oracle9Dialect
com.intellij.javaee.persistence.datasource: LocalScott
hibernate.cache.use_second_level_cache: false
hibernate.format_sql: true
hibernate.connection.username: scott
hibernate.archive.autodetection: false
hibernate.connection.url: jdbc:oracle:thin:@server:1521:sid
hibernate.bytecode.use_reflection_optimizer: true
hibernate.show_sql: true
hibernate.connection.password: tiger
]]
17:43:53,338 DEBUG JarVisitor:76 - JAR URL from URL Entry: file:/C:/projects/sample/target/classes/META-INF/persistence.xml >> file:/C:/projects/sample/target/classes
17:43:53,338 DEBUG Ejb3Configuration:97 - Detect class: false; detect hbm: false
17:43:53,338 DEBUG JarVisitor:97 - Searching mapped entities in jar/par: file:/C:/projects/sample/target/classes
17:44:01,089 DEBUG AnnotationConfiguration:97 - Process hbm files
17:44:01,089 DEBUG AnnotationConfiguration:97 - Process annotated classes
17:44:01,089 DEBUG AnnotationConfiguration:97 - processing manytoone fk mappings
17:44:01,089 DEBUG Configuration:97 - processing extends queue
17:44:01,089 DEBUG Configuration:97 - processing collection mappings
17:44:01,089 DEBUG Configuration:97 - processing native query and ResultSetMapping mappings
17:44:01,089 DEBUG Configuration:97 - processing association property references
17:44:01,104 DEBUG Configuration:97 - processing foreign key constraints
17:44:01,104 INFO AnnotationConfiguration:118 - Hibernate Validator not found: ignoring
17:44:01,229 INFO DriverManagerConnectionProvider:118 - Using Hibernate built-in connection pool (not for production use!)
17:44:01,229 INFO DriverManagerConnectionProvider:118 - Hibernate connection pool size: 20
17:44:01,229 INFO DriverManagerConnectionProvider:118 - autocommit mode: true
17:44:01,245 INFO DriverManagerConnectionProvider:118 - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@server:1521:sid
17:44:01,245 INFO DriverManagerConnectionProvider:118 - connection properties: {user=scott, password=tiger, autocommit=true, release_mode=auto}
17:44:01,245 DEBUG DriverManagerConnectionProvider:76 - total checked-out connections: 0
17:44:01,245 DEBUG DriverManagerConnectionProvider:97 - opening new JDBC connection
17:44:01,870 DEBUG DriverManagerConnectionProvider:97 - created connection to: jdbc:oracle:thin:@server:1521:sid, Isolation Level: 2
17:44:01,886 INFO SettingsFactory:118 - RDBMS: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
17:44:01,886 DEBUG DriverManagerConnectionProvider:76 - returning connection to pool, pool size: 1
17:44:01,932 INFO Dialect:118 - Using dialect: org.hibernate.dialect.Oracle9Dialect
17:44:01,948 INFO TransactionFactoryFactory:118 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
17:44:01,948 INFO TransactionManagerLookupFactory:118 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
17:44:01,948 INFO SettingsFactory:118 - Automatic flush during beforeCompletion(): disabled
17:44:01,948 INFO SettingsFactory:118 - Automatic session close at end of transaction: disabled
17:44:01,948 INFO SettingsFactory:118 - JDBC batch size: 15
17:44:01,948 INFO SettingsFactory:118 - JDBC batch updates for versioned data: disabled
17:44:01,948 INFO SettingsFactory:118 - Scrollable result sets: enabled
17:44:01,964 DEBUG SettingsFactory:97 - Wrap result sets: disabled
17:44:01,964 INFO SettingsFactory:118 - JDBC3 getGeneratedKeys(): disabled
17:44:01,964 INFO SettingsFactory:118 - Connection release mode: auto
17:44:01,964 INFO SettingsFactory:118 - Default batch fetch size: 1
17:44:01,964 INFO SettingsFactory:118 - Generate SQL with comments: disabled
17:44:01,964 INFO SettingsFactory:118 - Order SQL updates by primary key: disabled
17:44:01,964 INFO SettingsFactory:118 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
17:44:01,964 INFO ASTQueryTranslatorFactory:118 - Using ASTQueryTranslatorFactory
17:44:01,964 INFO SettingsFactory:118 - Query language substitutions: {}
17:44:01,964 INFO SettingsFactory:118 - JPA-QL strict compliance: enabled
17:44:01,964 INFO SettingsFactory:118 - Second-level cache: disabled
17:44:01,964 INFO SettingsFactory:118 - Query cache: disabled
17:44:01,964 INFO SettingsFactory:118 - Optimize cache for minimal puts: disabled
17:44:01,964 INFO SettingsFactory:118 - Structured second-level cache entries: disabled
17:44:01,979 DEBUG SQLExceptionConverterFactory:76 - Using dialect defined converter
17:44:01,979 INFO SettingsFactory:118 - Echoing all SQL to stdout
17:44:01,979 INFO SettingsFactory:118 - Statistics: disabled
17:44:01,979 INFO SettingsFactory:118 - Deleted entity synthetic identifier rollback: disabled
17:44:01,995 INFO SettingsFactory:118 - Default entity-mode: pojo
17:44:01,995 INFO SettingsFactory:118 - Named query checking : enabled
17:44:02,042 INFO SessionFactoryImpl:118 - building session factory
17:44:02,042 DEBUG SessionFactoryImpl:97 - Session factory constructed with filter configurations : {}
17:44:02,042 DEBUG SessionFactoryImpl:97 - instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:oracle:thin:@server:1521:sid, sun.management.compiler=HotSpot Client Compiler, hibernate.ejb.discard_pc_on_close=false, hibernate.transaction.flush_before_completion=false, os.name=Windows XP, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.Oracle9Dialect, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.archive.autodetection=false, , hibernate.cache.use_second_level_cache=false, file.encoding=windows-1252, hibernate.use_identifier_rollback=false, java.specification.version=1.5, hibernate.show_sql=true}
17:44:02,464 DEBUG AbstractEntityPersister:97 - Static SQL for entity: org.hibernate.test.annotations.id.Cat
17:44:02,464 DEBUG AbstractEntityPersister:97 - Version select: select CAT_ID from CAT where CAT_ID =?
17:44:02,464 DEBUG AbstractEntityPersister:97 - Snapshot select: select cat_.CAT_ID, cat_.NAME as NAME0_ from CAT cat_ where cat_.CAT_ID=?
17:44:02,464 DEBUG AbstractEntityPersister:97 - Insert 0: insert into CAT (NAME, CAT_ID) values (?, ?)
17:44:02,464 DEBUG AbstractEntityPersister:97 - Update 0: update CAT set NAME=? where CAT_ID=?
17:44:02,464 DEBUG AbstractEntityPersister:97 - Delete 0: delete from CAT where CAT_ID=?
17:44:02,557 DEBUG EntityLoader:97 - Static select for entity org.hibernate.test.annotations.id.Cat: select cat0_.CAT_ID as CAT1_0_0_, cat0_.NAME as NAME0_0_ from CAT cat0_ where cat0_.CAT_ID=?
17:44:02,557 DEBUG EntityLoader:97 - Static select for entity org.hibernate.test.annotations.id.Cat: select cat0_.CAT_ID as CAT1_0_0_, cat0_.NAME as NAME0_0_ from CAT cat0_ where cat0_.CAT_ID=?
17:44:02,557 DEBUG EntityLoader:97 - Static select for entity org.hibernate.test.annotations.id.Cat: select cat0_.CAT_ID as CAT1_0_0_, cat0_.NAME as NAME0_0_ from CAT cat0_ where cat0_.CAT_ID=? for update
17:44:02,557 DEBUG EntityLoader:97 - Static select for entity org.hibernate.test.annotations.id.Cat: select cat0_.CAT_ID as CAT1_0_0_, cat0_.NAME as NAME0_0_ from CAT cat0_ where cat0_.CAT_ID=? for update nowait
17:44:02,557 DEBUG EntityLoader:97 - Static select for entity org.hibernate.test.annotations.id.Cat: select cat0_.CAT_ID as CAT1_0_0_, cat0_.NAME as NAME0_0_ from CAT cat0_ where cat0_.CAT_ID=? for update nowait
17:44:02,573 DEBUG EntityLoader:97 - Static select for action ACTION_MERGE on entity org.hibernate.test.annotations.id.Cat: select cat0_.CAT_ID as CAT1_0_0_, cat0_.NAME as NAME0_0_ from CAT cat0_ where cat0_.CAT_ID=?
17:44:02,573 DEBUG EntityLoader:97 - Static select for action ACTION_REFRESH on entity org.hibernate.test.annotations.id.Cat: select cat0_.CAT_ID as CAT1_0_0_, cat0_.NAME as NAME0_0_ from CAT cat0_ where cat0_.CAT_ID=?
17:44:02,573 DEBUG SessionFactoryObjectFactory:97 - initializing class SessionFactoryObjectFactory
17:44:02,573 DEBUG SessionFactoryObjectFactory:97 - registered: 4028801b1308c9b0011308c9b28d0000 (unnamed)
17:44:02,573 INFO SessionFactoryObjectFactory:118 - Not binding factory to JNDI, no JNDI name configured
17:44:02,573 DEBUG SessionFactoryImpl:97 - instantiated session factory
17:44:02,573 DEBUG SessionFactoryImpl:97 - Checking 0 named HQL queries
17:44:02,573 DEBUG SessionFactoryImpl:97 - Checking 0 named SQL queries
17:44:02,667 DEBUG SessionImpl:97 - opened session at timestamp: 11812634426
17:44:02,667 DEBUG JDBCTransaction:97 - begin
17:44:02,667 DEBUG ConnectionManager:97 - opening JDBC connection
17:44:02,667 DEBUG DriverManagerConnectionProvider:76 - total checked-out connections: 0
17:44:02,667 DEBUG DriverManagerConnectionProvider:76 - using pooled JDBC connection, pool size: 0
17:44:02,667 DEBUG JDBCTransaction:97 - current autocommit status: true
17:44:02,667 DEBUG JDBCTransaction:97 - disabling autocommit
17:44:02,667 DEBUG JDBCContext:76 - after transaction begin
17:44:02,682 DEBUG IdentifierValue:76 - id unsaved-value strategy UNDEFINED
17:44:02,682 DEBUG AbstractSaveEventListener:76 - transient instance of: org.hibernate.test.annotations.id.Cat
17:44:02,682 DEBUG DefaultPersistEventListener:76 - saving transient instance
17:44:02,682 DEBUG AbstractSaveEventListener:97 - generated identifier: 0, using strategy: org.hibernate.id.Assigned
17:44:02,682 DEBUG AbstractSaveEventListener:76 - saving [org.hibernate.test.annotations.id.Cat#0]
17:44:02,698 DEBUG IdentifierValue:76 - id unsaved-value strategy UNDEFINED
17:44:02,698 DEBUG AbstractSaveEventListener:76 - transient instance of: org.hibernate.test.annotations.id.Cat
17:44:02,698 DEBUG DefaultPersistEventListener:76 - saving transient instance
17:44:02,698 DEBUG AbstractSaveEventListener:97 - generated identifier: 0, using strategy: org.hibernate.id.Assigned
17:44:02,698 DEBUG AbstractSaveEventListener:76 - saving [org.hibernate.test.annotations.id.Cat#0]
17:44:02,698 DEBUG AbstractEntityManagerImpl:97 - mark transaction for rollback
javax.persistence.PersistenceException: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [org.hibernate.test.annotations.id.Cat#0]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:219)
at org.hibernate.test.annotations.id.VetTest.createCat(VetTest.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:479)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:715)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:673)
at org.testng.TestRunner.privateRun(TestRunner.java:620)
at org.testng.TestRunner.run(TestRunner.java:480)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:278)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:273)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:253)
at org.testng.SuiteRunner.run(SuiteRunner.java:168)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:987)
at org.testng.TestNG.runSuitesLocally(TestNG.java:951)
at org.testng.TestNG.run(TestNG.java:719)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [org.hibernate.test.annotations.id.Cat#0]
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:168)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:213)
... 27 more
17:44:02,698 INFO SessionFactoryImpl:118 - closing
17:44:02,714 INFO DriverManagerConnectionProvider:118 - cleaning up connection pool: jdbc:oracle:thin:@server:1521:sid
===============================================
Custom suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================
Process finished with exit code 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years