[Hibernate-JIRA] Created: (ANN-436) @IndexColumn does not work with discriminator-inheritance on the target entity of the list
by ron piterman (JIRA)
@IndexColumn does not work with discriminator-inheritance on the target entity of the list
------------------------------------------------------------------------------------------
Key: ANN-436
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-436
Project: Hibernate Annotations
Type: Bug
Versions: 3.2.0.cr1
Reporter: ron piterman
When using inheritance on the target entity of a List, @IndexColumn annotation does not work. Hibernate does not populate the index column value on the target entites. As a result, the sort_order column is null.
@Entity
public class PropertyOwner {
@OneToMany
@IndexColumn(name="sort_order", mappedBy="owner",cascade=CascadeType.ALL)
private List<AbstractProperty> properties;
...
}
@Entity
@DiscriminatorColumn(name="property_type",discriminatorType=DiscriminatorType.STRING)
public abstract class AbstractProperty {
@ManyToOne
private PropertyOwner owner;
}
@Entity
@DiscriminatorValue("integer")
public class IntegerProperty extends AbstractProperty {
int integerValue;
...
}
@Entity
@DiscriminatorValue("string")
public class IntegerProperty extends AbstractProperty {
String stringValue
...
}
--
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
19 years, 2 months
[Hibernate-JIRA] Created: (HHH-2175) L2 Cache performance is very very bad when writing other kinds of objects in the same transaction
by Sami Dalouche (JIRA)
L2 Cache performance is very very bad when writing other kinds of objects in the same transaction
-------------------------------------------------------------------------------------------------
Key: HHH-2175
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2175
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.0.ga
Environment: Hibernate Entity Manager 3.2.0 + Annotations + Core
Reporter: Sami Dalouche
Hibernate L2 Cache performance is very slow when writing objects in the same transaction.
For instance. Let's say we have 2 completly unrelated classes A and B
let's say A never changes, and we write tons of instances of B to the database. Both A and B are managed by the cache, but into differet cache regions (with different Ehcache configurations).
So, let's consider a simple example like :
loop 1:
for(int i = 0 ; i < 10000 ; i++){
new A();
}
and loop2:
for(int i = 0 ; i < 10000 ; i++){
aDao.findAByKey("key");
}
Since the L2 cache + Query cache is activatedon a + findAByKey, loop2's performance is comparable to loop's 1 one. It's pretty much the same, so everything is fine, so far. Let's call X the time taken by loop1 or loop2, that we consider equal.
Now, let's consider loop3 and loop4:
loop 3:
for(int i = 0 ; i < 10000 ; i++){
new A();
bDao.save(new B());
}
and loop4:
for(int i = 0 ; i < 10000 ; i++){
aDao.findAByKey("key");
bDao.save(new B());
}
So, now, let's consider that saving bDao.save(new B()) takes Y seconds for 10,000 iterations.
You would expect loop3 and loop4 to have the same performance, roughly , X + Y, right ?
Well, actually, loop3 takes X + Y.
But loop4 takes around 20 * (X + Y) !!!!!!! (on my machine, so it can be slighly different). But you see the point : there is a HUGE difference of performance.
I am sure there are design reasons for this, that's why I set this bug as an enhancement.. So, 2 things :
* either it is possible to solve this issue, and it would be nice to correct it
* either it is not possible to solve this issue, and it would be nice to add a section in the reference manual, explaining why hibernate behaves that way.
Regards,
Sami Dalouche
--
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
19 years, 2 months
[Hibernate-JIRA] Created: (HHH-2172) Could not determine fecht owner exception with 3.2.0GA (worked in 3.2rc2)
by Alexander Rupsch (JIRA)
Could not determine fecht owner exception with 3.2.0GA (worked in 3.2rc2)
-------------------------------------------------------------------------
Key: HHH-2172
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2172
Project: Hibernate3
Type: Bug
Versions: 3.2.0.ga
Environment: Annotations 3.2.0GA (16.10.06)
Core 3.2.0GA (16.10.06)
Reporter: Alexander Rupsch
HI,
I have a named query like this:
<sql-query name="loadMDGraphJoined-AllPathFromAndToChildSlow">
<return-join alias="parent" property="goe.parent"/>
<return-join alias="child" property="goe.child"/>
<return alias="goe" class="com.ecg.mts.tsm.impl.domain.MasterDataEdge"/>
<![CDATA[
select
pa.id AS {parent.id},
pa.periodstart AS {parent.validPeriod.start},
pa.periodend AS {parent.validPeriod.end},
pa.shortdesc AS {parent.shortDesc},
pa.longdesc AS {parent.longDesc},
pa.name AS {parent.name},
pa.class AS {parent.class},
pa.clientid AS {parent.clientId},
ch.id AS {child.id},
ch.periodstart AS {child.validPeriod.start},
ch.periodend AS {child.validPeriod.end},
ch.shortdesc AS {child.shortDesc},
ch.longdesc AS {child.longDesc},
ch.name AS {child.name},
ch.class AS {child.class},
ch.clientid AS {child.clientId},
goe.parent_id AS {goe.parent},
goe.child_id AS {goe.child},
goe.id AS {goe.id}
from tsm_master_data pa, tsm_master_data ch,
(select DISTINCT ROWID, goe.* from tsm_master_data_edge goe
start with parent_id in (
( /* Selection der Pfade nach "oben" */
SELECT DISTINCT goe2.parent_id
FROM tsm_master_data_edge goe2
START WITH goe2.child_id = :parentId
OR goe2.child_id IN ((SELECT DISTINCT child_id
FROM tsm_master_data_edge
START WITH parent_id = :parentId
CONNECT BY PRIOR parent_id = child_id))
CONNECT BY PRIOR goe2.parent_id = goe2.child_id
)
) or parent_id = :parentId
connect by prior goe.child_id = goe.parent_id) goe
where pa.id = goe.parent_id
and ch.id = goe.child_id
]]>
</sql-query>
And I call it like this (using spring):
List items = getHibernateTemplate().findByNamedQueryAndNamedParam(
"loadMDGraphJoined-AllPathFromAndToChildSlow", "parentId", id);
This works fine with Core 3.2.0rc2 and annotations 3.2.0rc1. After switching to 3.2.0GA I got the following exception:
org.springframework.orm.hibernate3.HibernateSystemException: Could not determine fetch owner : null; nested exception is org.hibernate.HibernateException: Could not determine fetch owner : null
org.hibernate.HibernateException: Could not determine fetch owner : null
at org.hibernate.loader.custom.CustomLoader.determineAppropriateOwnerPersister(CustomLoader.java:250)
at org.hibernate.loader.custom.CustomLoader.<init>(CustomLoader.java:150)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1688)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150)
at org.springframework.orm.hibernate3.HibernateTemplate$35.doInHibernate(HibernateTemplate.java:947)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366)
at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:938)
at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:928)
at com.ecg.mts.tsm.impl.persistence.HibernateMasterDataRepository.getMasterDataGraphComplete(HibernateMasterDataRepository.java:116)
at com.ecg.mts.tsm.test.persistence.MasterDataRepositoryTestBase.testGetMasterDataGraphComplete(MasterDataRepositoryTestBase.java:201)
at com.ecg.mts.tsm.test.persistence.hibernate.HibernateMasterDataRepositoryTest.testGetMasterDataGraphComplete(HibernateMasterDataRepositoryTest.java:39)
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)
The variable "entityName" in CustomerLoader.determineAppropriateOwnerPersister() ist null because the parameter ownerDescriptor ist null. This is because EntityFetchReturn.getOwner also returns null at line 146.
--
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
19 years, 2 months
[Hibernate-JIRA] Created: (HHH-1979) Unable to locate current JTA transaction
by Kuldeep Singh Virdi (JIRA)
Unable to locate current JTA transaction
----------------------------------------
Key: HHH-1979
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1979
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1
Environment: Hibernat 3.1, My-SQL 5.0, JBOss
Reporter: Kuldeep Singh Virdi
Hi,
I have made a hibernate-service.xml file and deployed it under myApplication.har file
The xml file contents are
<?xml version="1.0"?>
<server>
<mbean code="org.hibernate.jmx.HibernateService"
name="jboss.jca:service=HibernateFactory,name=HibernateFactory">
<!-- Required services -->
<depends>jboss.jca:service=RARDeployer</depends>
<!-- Bind the Hibernate service to JNDI -->
<attribute name="JndiName">java:/hibernate/SessionFactory</attribute>
<!-- Datasource settings -->
<attribute name="Datasource">java:/jdbc/mysqlserverr</attribute>
<attribute name="Dialect">org.hibernate.dialect.MySQLDialect</attribute>
<!-- Transaction integration -->
<attribute name="TransactionStrategy">
org.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">
org.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="FlushBeforeCompletionEnabled">true</attribute>
<attribute name="AutoCloseSessionEnabled">true</attribute>
<!-- Fetching options -->
<attribute name="MaximumFetchDepth">5</attribute>
<!-- Second-level caching -->
<attribute name="SecondLevelCacheEnabled">true</attribute>
<attribute name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute>
<attribute name="QueryCacheEnabled">true</attribute>
<!-- Logging -->
<attribute name="ShowSqlEnabled">true</attribute>
</mbean>
</server>
Through my Stateless Session EJB i call a method
private Session getSession() {
if (sessionFactory == null)
sessionFactory = // by look up
}
return sessionFactory.getCurrentSession();
}
I get following excpetion
09:29:14,304 INFO [STDOUT] org.hibernate.HibernateException: Unable to locate current JTA transaction
at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:604)
at com.daffodilwoods.framework.datasource.ResourceManager.currentSession(ResourceManager.java:234)
at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getHibernateSession(DataObjectMetaD
at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getDefaultColumns(DataObjectMetaDat
at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getObject(DataObjectMetaDataLoader.
at com.daffodilwoods.framework.core.view.server.metadataloader.AbsTableMetaDataUtil.loadMetadata(AbsTableMetaDataU
at com.daffodilwoods.framework.table.server.TableMetaDataLoader.getObject(TableMetaDataLoader.java:87)
at com.daffodilwoods.framework.table.server.TableService.createView(TableService.java:32)
at com.daffodilwoods.framework.core.view.server.service.AbsViewService.init(AbsViewService.java:41)
at com.daffodilwoods.framework.core.view.server.service.AbsViewService.getViewMetaDataHandler(AbsViewService.java:
at com.daffodilwoods.framework.table.server.TableService.getData(TableService.java:56)
at com.daffodilwoods.framework.core.view.server.service.AbsViewService.getData(AbsViewService.java:68)
at com.daffodilwoods.framework.core.view.server.service.ViewService.getData(ViewService.java:71)
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.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:299)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
09:29:14,304 INFO [STDOUT] org.hibernate.HibernateException: Unable to locate current JTA transaction
Can u tell me wht can i do for it.
I think there is not support for providing currentSessionContext attribute in this xml file also
Please reply
--
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
19 years, 2 months
[Hibernate-JIRA] Created: (HHH-2043) There is an bug in InformixDialect preventing generator-class=native to work.
by Andrew from Poland (JIRA)
There is an bug in InformixDialect preventing generator-class=native to work.
-----------------------------------------------------------------------------
Key: HHH-2043
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2043
Project: Hibernate3
Type: Bug
Components: query-sql
Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2, 3.2.0.cr3, 3.2.0.cr4
Environment: hibernate version 3.1.3, IBM Informix Dynamic Server Version 10.00.FC3R1, JDBC IBM Informix driver ver 3.0.JC3 (ifxjdbc-3.0-jc3.jar)
Reporter: Andrew from Poland
Priority: Minor
When there is an column of SERIAL or SERIAL8 type (identity types in Informix) database expect this column to appear in INSERT clause with value equal 0, for example:
INSERT into my_table (my_serial_column, other_column) values (0, "some value"); - in this example my_serial_column is an identity column.
Using current InformixDialect this insert looks like this:
INSERT into my_table (other_column) values ( "some value");
which causes an exception:
java.sql.SQLException: Error In Specifying Automatically (Server) Generated Keys.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executePrepare(IfxSqli.java:1153)
at com.informix.jdbc.IfxPreparedStatement.e(IfxPreparedStatement.java:318)
at com.informix.jdbc.IfxPreparedStatement.a(IfxPreparedStatement.java:298)
at com.informix.jdbc.IfxPreparedStatement.<init>(IfxPreparedStatement.java:275)
at com.informix.jdbc.IfxSqliConnect.prepareStatement(IfxSqliConnect.java:2077)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:418)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:385)
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.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:40)
at $Proxy10.prepareStatement(Unknown Source)
...
I've tested a solution - dialect must redefine getIdentityInsertString method like this:
public String getIdentityInsertString() {
return "0";
}
After that identity column appear in INSERT clause with value set to 0.
I'am using hibernate version 3.1.3, but in the latest build 3.2.0.cr4 problem still exist (i've downloaded it and checked InformixDialect.java file).
--
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
19 years, 4 months