[Hibernate-JIRA] Created: (HHH-4903) Ambiguous column in field list
by Luis Eduardo Villares Matta (JIRA)
Ambiguous column in field list
------------------------------
Key: HHH-4903
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4903
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-4
Environment: O.S.: Linux 2.6.28-18-generic #59-Ubuntu SMP Thu Jan 28 01:40:19 UTC 2010 x86_64 GNU/Linux
Java.: Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
Web server: jetty-hightide-7.0.1.v20091125
DB Server: mysql Ver 14.14 Distrib 5.1.31, for debian-linux-gnu (x86_64) using EditLine wrapper
Reporter: Luis Eduardo Villares Matta
Priority: Blocker
When executing entityManager.find(ClassName.class, pk) caught the exception below.
Entities involved in the query below do not have any inheritance relationship (just composition), but they all contain a field named "private" (column name "_private")
Hibernate:
select
libraryite0_.id as id2_2_,
libraryite0_.active as active2_2_,
libraryite0_.createdDate as createdD3_2_2_,
libraryite0_.deleted as deleted2_2_,
libraryite0_.updatedDate as updatedD5_2_2_,
libraryite0_.defaultLocale as defaultL6_2_2_,
libraryite0_.name as name2_2_,
libraryite0_.parentId as parentId2_2_,
_private as column8_2_2_,
libraryite0_.typeId as typeId2_2_,
libraryite1_.id as id2_0_,
libraryite1_.active as active2_0_,
libraryite1_.createdDate as createdD3_2_0_,
libraryite1_.deleted as deleted2_0_,
libraryite1_.updatedDate as updatedD5_2_0_,
libraryite1_.defaultLocale as defaultL6_2_0_,
libraryite1_.name as name2_0_,
libraryite1_.parentId as parentId2_0_,
_private as column8_2_0_,
libraryite1_.typeId as typeId2_0_,
libraryite2_.id as id5_1_,
libraryite2_.active as active5_1_,
libraryite2_.createdDate as createdD3_5_1_,
libraryite2_.deleted as deleted5_1_,
libraryite2_.updatedDate as updatedD5_5_1_,
libraryite2_.folderish_ as folderish6_5_1_,
libraryite2_.libraryId as libraryId5_1_,
libraryite2_.name as name5_1_,
libraryite2_.xsd_ as xsd8_5_1_,
libraryite2_.xpaths_ as xpaths9_5_1_
from
TKBMLibraryItem libraryite0_
left outer join
TKBMLibraryItem libraryite1_
on libraryite0_.parentId=libraryite1_.id
left outer join
TKBMLibraryItemType libraryite2_
on libraryite1_.typeId=libraryite2_.id
where
libraryite0_.id=?
174363 [qtp1469937134-21] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1052, SQLState: 23000
174363 [qtp1469937134-21] ERROR org.hibernate.util.JDBCExceptionReporter - Column '_private' in field list is ambiguous
174363 [qtp1469937134-21] INFO org.hibernate.event.def.DefaultLoadEventListener - Error performing load command
org.hibernate.exception.ConstraintViolationException: could not load an entity: [com.totvs.kbm.model.LibraryItemModel#10128]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:95)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1916)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3212)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:437)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:418)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:223)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:126)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:990)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:538)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:513)
at com.totvs.kbm.service.KnowledgeService.getLibraryItem(KnowledgeService.java:476)
at org.apache.jsp.html.kbm.rootitemsnavigation_jsp._jspService(org.apache.jsp.html.kbm.rootitemsnavigation_jsp:179)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216)
at com.totvs.kbm.core.web.RequestPipeline.doFilter(RequestPipeline.java:132)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:425)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:457)
at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
at org.eclipse.jetty.server.Server.handle(Server.java:334)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:992)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:541)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column '_private' in field list is ambiguous
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2077)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2228)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1827)
at org.hibernate.loader.Loader.doQuery(Loader.java:714)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1902)
... 45 more
2010-02-10 14:48:50.375:WARN::/html/kbm/rootitemsnavigation.jsp
javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not load an entity: [com.totvs.kbm.model.LibraryItemModel#10128]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1197)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:558)
at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:513)
at com.totvs.kbm.service.KnowledgeService.getLibraryItem(KnowledgeService.java:476)
at org.apache.jsp.html.kbm.rootitemsnavigation_jsp._jspService(org.apache.jsp.html.kbm.rootitemsnavigation_jsp:179)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216)
at com.totvs.kbm.core.web.RequestPipeline.doFilter(RequestPipeline.java:132)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:425)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:457)
at org.eclipse.jetty.server.session.SessionHandler.handle(SessionHandler.java:182)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:933)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:245)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113)
at org.eclipse.jetty.server.Server.handle(Server.java:334)
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559)
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:992)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:541)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:203)
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
at java.lang.Thread.run(Thread.java:619)
--
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
14 years, 5 months
[Hibernate-JIRA] Created: (HHH-4624) QueryImpl.list() closes connection
by Dieter Freismuth (JIRA)
QueryImpl.list() closes connection
----------------------------------
Key: HHH-4624
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4624
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: linux,
postgres 8.3 (same on oracle 11g, mssql 2005 and mysql)
Reporter: Dieter Freismuth
Priority: Critical
if an outer query.iterate() calls within an iteration step a query.list() the connection is closed and the next outer iteration step causes:
org.hibernate.exception.JDBCConnectionException: could not get next iterator result
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.impl.IteratorImpl.next(IteratorImpl.java:156)
the exception is only thrown if there is no transaction!
(works fine if done within an transaction)
call hierarchy:
QueryImpl.list()
-> SessionImpl.list(String query, QueryParameters queryParameters)
-> afterOperation(success); // within finally block
-> JDBCContext.afterNontransactionalQuery( success )
-> ConnectionManager.afterTransaction()
-> ConnectionManager.aggressiveRelease() // within if ( isAfterTransactionRelease() ) {
-> ConnectionManager.closeConnection()
--
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
14 years, 5 months
[Hibernate-JIRA] Created: (HHH-4832) Secondary tables do not work in JOINED or TABLE_PER_CLASS inheritance strategies
by Simon Godden (JIRA)
Secondary tables do not work in JOINED or TABLE_PER_CLASS inheritance strategies
--------------------------------------------------------------------------------
Key: HHH-4832
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4832
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: Hibernate 3.3.2, Postgres 8.4.2
Reporter: Simon Godden
Attachments: hibernatetest2.tgz
I have a class hierarchy as follows:
{noformat}
Abstract RootClass (Mapped Superclass)
|
\ /
Abstract IntermediateClass (Entity)
| |
\ / \ /
LeafClass (Entity) LeafClass2 (Entity)
{noformat}
The following table shows which attributes are on each class:
||Class||Attribute||Table||
|RootClass|field1|rootclass|
|IntermediateClass|field2|intermediateclass|
|LeafClass|field3|leafclass|
|LeafClass|field4|leafclass2|
|AnotherLeafClass|field5|anotherleafclass|
|AnotherLeafClass|field6|anotherleafclass2|
Using {{InheritanceType.SINGLE_TABLE}}, it works.
Using {{InheritanceType.JOINED}} or {{InheritanceType.TABLE_PER_CLASS}} at the {{IntermediateClass}} level causes different errors:
Using {{InheritanceType.JOINED}} causes an incorrect insert statement which thinks that {{field4}} is on table {{leafclass}} rather than {{leafclass2}}:
{noformat}
Hibernate:
insert
into
LeafClass
(field1, field2, field3, field4, id)
values
(?, ?, ?, ?, ?)
Exception in thread "main" [22/01/10 03:17:53:053 GMT] WARN util.JDBCExceptionReporter: SQL Error: 0, SQLState: null
[22/01/10 03:17:53:053 GMT] ERROR util.JDBCExceptionReporter: Batch entry 0 insert into LeafClass (field1, field2, field3, field4, id) values (foo1, foo2, foo3, foo4, 1) was aborted. Call getNextException to see the cause.
[22/01/10 03:17:53:053 GMT] WARN util.JDBCExceptionReporter: SQL Error: 0, SQLState: 42703
[22/01/10 03:17:53:053 GMT] ERROR util.JDBCExceptionReporter: ERROR: column "field4" of relation "leafclass" does not exist
{noformat}
Using {{InheritanceType.TABLE_PER_CLASS}} causes the following error as the session factory is built:
{noformat}
[22/01/10 03:06:05:005 GMT] INFO cfg.SettingsFactory: Echoing all SQL to stdout
[22/01/10 03:06:05:005 GMT] INFO cfg.SettingsFactory: Statistics: disabled
[22/01/10 03:06:05:005 GMT] INFO cfg.SettingsFactory: Deleted entity synthetic identifier rollback: disabled
[22/01/10 03:06:05:005 GMT] INFO cfg.SettingsFactory: Default entity-mode: pojo
[22/01/10 03:06:05:005 GMT] INFO cfg.SettingsFactory: Named query checking : enabled
[22/01/10 03:06:05:005 GMT] INFO impl.SessionFactoryImpl: building session factory
[22/01/10 03:06:06:006 GMT] ERROR hibernate.AssertionFailure: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: Table leafclass2 not found
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:480)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:259)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:87)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:267)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at tests.inheritdomain.SessionManager.initialiseSessionFactory(SessionManager.java:23)
at tests.inheritdomain.SessionManager.openSession(SessionManager.java:14)
at tests.inheritdomain.TestSecondaryTablesInInheritance.test(TestSecondaryTablesInInheritance.java:20)
at tests.inheritdomain.TestSecondaryTablesInInheritance.main(TestSecondaryTablesInInheritance.java:44){noformat}
A minimal test case is attached as an maven and eclipse project. mvn test will show the error. I have not created a test case for each inheritance type - you will have to change it in the intermediate domain class to see the other error.
--
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
14 years, 5 months
[Hibernate-JIRA] Created: (HHH-2470) Use of session.createSQLQuery causes memory leak
by Bjørn Bjerkeli (JIRA)
Use of session.createSQLQuery causes memory leak
-------------------------------------------------
Key: HHH-2470
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2470
Project: Hibernate3
Type: Bug
Components: query-sql
Versions: 3.1.3
Environment: Win XP, Oracle 10g, Java 1.4.2
Reporter: Bjørn Bjerkeli
Attachments: TestCase.zip
NativeSQLQuerySpecification fails to properly implement equals and hashcode caused by lacking implementation of hashCode and equals in all SQLQueryReturn implementations and SQLQueryScalarReturn which are members of NativeSQLQuerySpecification. I can see that NativeSQLQuerySpecification has been changed in 3.2, but the problem is still there.
NativeSQLQuerySpecification instances are used as keys for retrieving and caching NativeSQLQueryPlan instances.
This causes the caching-mechanism to be pretty useless when Queries created by session.createSQLQuery because new entries will be added all the time in the QueryPlanCache and the SoftLimitMRUCache member.
So far so good, the more serious problem that is caused by this is stems from the implementation of SoftLimitMRUCache which again uses LRUMap in commons-collection. The put - method of the cache is not treadsafe, and that causes the following fragment in LRUMap to allow the map to grow beyond its maximumSize. That is bacause the containsKey method will return an incorrect result when concurrently updating the map.
public Object put( Object key, Object value ) {
int mapSize = size();
Object retval = null;
if ( mapSize >= maximumSize ) {
// don't retire LRU if you are just
// updating an existing key
if (!containsKey(key)) {
// lets retire the least recently used item in the cache
removeLRU();
}
}
retval = super.put(key,value);
return retval;
}
I have included a test-case that demonstrates:
1) Wrong implementation of equals and hashCode in NativeSQLQuerySpecification
2) Concurrent use of LRUMap causes the map to grow beyound it's max limit
3) Concurrent execution of session.createSQLQuery causes memory leak due to 1) and 2)
I would be more than happy to contribute to get this fixed. Just let me know.
--
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
14 years, 5 months
[Hibernate-JIRA] Created: (HHH-3221) Cascading performance problems when session contains many entities
by Yves Galante (JIRA)
Cascading performance problems when session contains many entities
------------------------------------------------------------------
Key: HHH-3221
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3221
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.3.0.CR1, 3.2.6, 3.2.5
Reporter: Yves Galante
Attachments: patchCascading.patch, SaveTest.zip
When session contains many entities, performence of cascading become very slow.
For each collection element the whole persistence context is searched (by StatefulPersistenceContext#getIndexInOwner() and StatefulPersistenceContext#getOwnerId) and its even searched twice when the collection is an indexed collection.
This patch optimize cascading operation by caching relation parent-child on a map.
eventSource.getPersistenceContext().addChildParent(child, parent);
action.cascade(eventSource, child, entityName, anything, isCascadeDeleteEnabled);
eventSource.getPersistenceContext().removeChildParent(child);
The test case save and flush 10 * 551 objects.
Before patch save object with cascading is more slow when session size grows.
After patch time of save stay same at each loop.
Output of the test case before the patch :
Save took 449 ms
Save took 669 ms
Save took 1042 ms
Save took 1464 ms
Save took 2481 ms
Save took 2741 ms
Save took 3807 ms
Save took 4344 ms
Save took 4975 ms
Save took 5251 ms
Total took 30906 ms
Output after the patch
Save took 445 ms
Save took 144 ms
Save took 164 ms
Save took 108 ms
Save took 93 ms
Save took 93 ms
Save took 93 ms
Save took 94 ms
Save took 91 ms
Save took 89 ms
Total took 4905 ms
--
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
14 years, 5 months
[Hibernate-JIRA] Created: (HHH-5266) NullPointer in toString of PersistentBag
by Jan Stolze (JIRA)
NullPointer in toString of PersistentBag
----------------------------------------
Key: HHH-5266
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5266
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Reporter: Jan Stolze
We have created an interceptor which keeps track of changes during a running transaction so in case of a rollback we can log which changes where issued before the rollback is performed. Now we sometimes see in case a rollback is issued the following stacktrace:
exception in interceptor afterTransactionCompletion()
java.lang.NullPointerException
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.initializeCollectionFromCache(DefaultInitializeCollectionEventListener.java:116)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:71)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
at org.hibernate.collection.PersistentBag.toString(PersistentBag.java:506)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at gti.db.DbRollbackLogginInterceptor$LogEntry.toString(DbRollbackLogginInterceptor.java:246)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at gti.db.DbRollbackLogginInterceptor.logRollback(DbRollbackLogginInterceptor.java:109)
at gti.db.DbRollbackLogginInterceptor.afterTransactionCompletion(DbRollbackLogginInterceptor.java:70)
at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:455)
at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:252)
at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:208)
at org.hibernate.ejb.TransactionImpl.rollback(TransactionImpl.java:85)
We do not have (at this moment) a clear overview of what has happend and what the exact conditions are for this NPE to occur, but think it is still important enough to report.
--
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
14 years, 5 months
[Hibernate-JIRA] Created: (ANN-793) @ManyToOne - @OneToMany doesn't work with @Inheritance(strategy= InheritanceType.JOINED)
by Tomaz Cerar (JIRA)
@ManyToOne - @OneToMany doesn't work with @Inheritance(strategy= InheritanceType.JOINED)
----------------------------------------------------------------------------------------
Key: ANN-793
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-793
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.4.0.GA
Environment:
Hibernate Core 3.3.1.GA
Hibernate Annotations 3.4.0 GA
Hibernate EntityManager 3.4.0 GA
Jboss 4.3 EAP,
DB2 9.5
Reporter: Tomaz Cerar
I am trying to create bidirectional association between two entities in which one can be Inherited and it fails with table not found:
11:37:39,229 ERROR [AssertionFailure] [] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: Table CRM.CRM_AKTIVNOST_DOGODKI not found
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:480)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:259)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:87)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
The code looks like this:
@Entity
@Table(name = "CRM_AKTIVNOST")
public class Aktivnost implements Serializable {
private List<Dogodek> dogodki;
....
....
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL,mappedBy = "aktivnost")
public List<Dogodek> getDogodki() {
return dogodki;
}
public void setDogodki(List<Dogodek> dogodki) {
this.dogodki = dogodki;
}
...
...
}
@Entity
@Table(name = "CRM_DOGODEK")
@Inheritance(strategy= InheritanceType.JOINED)
public class Dogodek implements Serializable {
...
...
private Aktivnost aktivnost;
....
....
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinTable(name = "CRM_AKTIVNOST_DOGODKI", joinColumns = {@JoinColumn(name = "DOGODEK_ID")}, inverseJoinColumns = {@JoinColumn(name = "AKTIVNOST_ID")})
public Aktivnost getAktivnost() {
return aktivnost;
}
public void setAktivnost(Aktivnost aktivnost) {
this.aktivnost = aktivnost;
}
...
}
--
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
14 years, 5 months