[Hibernate-JIRA] Created: (HHH-5052) EventListenerConfigurator uses Ejb3Configuration but could use AnnotationConfiguration instead
by Alexandre Walter Pretyman (JIRA)
EventListenerConfigurator uses Ejb3Configuration but could use AnnotationConfiguration instead
----------------------------------------------------------------------------------------------
Key: HHH-5052
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5052
Project: Hibernate Core
Issue Type: Improvement
Components: annotations, entity-manager
Affects Versions: 3.5.0-CR-2, 3.5.0-CR-1, 3.5.0-Beta-4, 3.5.0-Beta-3, 3.5.0-Beta-2, 3.5.0.Beta-1, 3.3.2, 3.3.1, 3.3.0.SP1, 3.3.0.GA, 3.3.0.CR2, 3.3.0.CR1, 3.2.7, 3.2.6
Environment: Tested with Hibernate 3.2.6ga, Annotations 3.2.1ga, EntityManager 3.3.2ga but seems to affect the code in the trunk.
Reporter: Alexandre Walter Pretyman
Priority: Trivial
The class EventListenerConfigurator uses Ejb3Configuration on it's constructor, but it could use AnnotationConfiguration directly, as the methods called on the Ejb3Configuration instance by the EventListenerConfigurator, are actually delegations to the AnnotationConfiguration .
--
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, 4 months
[Hibernate-JIRA] Created: (HHH-2309) fetch only the lazy property needed
by German de la Cruz (JIRA)
fetch only the lazy property needed
------------------------------------
Key: HHH-2309
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2309
Project: Hibernate3
Type: New Feature
Components: core
Versions: 3.2.1
Reporter: German de la Cruz
The method AbstractEntityPersister.initializeLazyProperty(..) load all lazy properties when it's called. It would be great if could only load the requested property.
I think the only change we need is in AbstractEntityPersister.initializeLazyPropertiesFromDatastore(...) and AbstractEntityPersister.initializeLazyPropertiesFromCache(...). We must change them in a way that only the referenced property is loaded.
After that, we must change AbstractFieldInterceptor.intercept(..) to update in a better way the unitializedFields collection (I mean, removing the actual property only instead of null it).
Besides. Why in line 777 to 780 a query is executed? I think it isn't necessary.
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
14 years, 4 months
[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, 4 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, 4 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, 4 months