[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
18 years
[Hibernate-JIRA] Created: (ANN-425) @ManyToOne defined as @Id in a @MappedSuperclass/@EmbeddableSuperclass can't be reached by an @OneToMany(mappedBy)
by Giampaolo Tomassoni (JIRA)
@ManyToOne defined as @Id in a @MappedSuperclass/@EmbeddableSuperclass can't be reached by an @OneToMany(mappedBy)
------------------------------------------------------------------------------------------------------------------
Key: ANN-425
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-425
Project: Hibernate Annotations
Type: Bug
Versions: 3.1beta3, 3.1beta4, 3.1beta5, 3.1beta6, 3.1beta7, 3.1beta8, 3.1beta9, 3.1.0.Beta10, 3.2.0.cr1
Environment: hibernate-3.2.CR2 + hibernate-annotations-3.2.0-CR1 + hibernate-entitymanager-3.2.0-CR1 under JBoss 4.0.4-GA and EJB3
Reporter: Giampaolo Tomassoni
Attachments: test01.zip
The case in subject reports the following error:
org.hibernate.AnnotationException: mappedBy reference an unknown property: biz.tomassoni.hibernate.test01.AB.a in biz.tomassoni.hibernate.test01.A.a
It is months now that this problem had been reported (by me and by other), but no progress.
I'm attaching a testcase in the hope it can be useful.
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-2006) ORA-01000: maximum open cursors exceeded
by Zhi An (JIRA)
ORA-01000: maximum open cursors exceeded
----------------------------------------
Key: HHH-2006
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2006
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3
Environment: Does not seem to matter. Using Oracle 10g JDBC, Oracle 9i database, Hibernate 3.1.3, and the LocalSessionFactoryBean. But reproduced with 9i driver.
Reporter: Zhi An
Update objects seemed to leave cursors open.
If a loop, I am looping through all the rows in a table and update each row.
If the table is large enough, I will run out of Oracle cursors. I am open and close a R/W transaction for each row.
If I only read the object, I will not run out the cursors.
The jUnit test is as follows. Please fill in a correct table name/dao class.
There was some mentioning on JBOSS that Oracle JDBC might be slow closing cursors. But the cursors run out even if I add delays to each row update.
Thanks for your help.
public void testVolume() throws Exception {
<DAOclass> dao =
(DAOclass) getAppContext().getBean(<BeanName>));
List<Long> ids = dao.getAllIds();
for (Long id : ids) {
this.update(id);
}
//If we reach here, success. The error was that cursor will be exhausted.
}
private void update(final Long id) throws Exception {
Runnable r = new Runnable() {
public void run() {
<DAOclass> dao =
(DAOclass) getAppContext().getBean(<BeanName>));
ObjectClass log = dao.getById(id);
String ext = log.getSomething();
if (ext != null && ext.startsWith("-")) {
log.setSomething(ext.substring(1));
} else {
log.setExtTransactionId("-" + ext);
}
}
};
this.runInTransaction(r);
}
Error log:
Hibernate:
/* load com.widerthan.rbt.model.data.ProfileTransactionLog */ select
profiletra0_.LOG_TRANSACTION_ID as LOG1_21_0_,
profiletra0_.VERSION as VERSION21_0_,
profiletra0_.CUSTOMER_NAME as CUSTOMER3_21_0_,
profiletra0_.REQUEST_TRANSACTION_ID as REQUEST4_21_0_,
profiletra0_.REQUEST_OPERATOR_ID as REQUEST5_21_0_,
profiletra0_.TRANSACTION_TYPE_ID as TRANSACT6_21_0_,
profiletra0_.SERVICE_CHANNEL_ID as SERVICE7_21_0_,
profiletra0_.USER_MSISDN as USER8_21_0_,
profiletra0_.DESCRIPTION as DESCRIPT9_21_0_,
profiletra0_.BILLING_TRANSACTION_ID as BILLING10_21_0_,
profiletra0_.PRICE as PRICE21_0_,
profiletra0_.EXT_TRANSACTION_ID as EXT12_21_0_,
profiletra0_.SERVICE_NAME as SERVICE13_21_0_,
profiletra0_.STATUS as STATUS21_0_,
profiletra0_.PROCESSING_TIME as PROCESSING15_21_0_,
profiletra0_.EXT_PROCESSING_TIME as EXT16_21_0_,
profiletra0_.LOGGED as LOGGED21_0_,
profiletra0_.USER_ID as USER18_21_0_,
profiletra0_.CUSTOMER_ID as CUSTOMER19_21_0_,
profiletra0_.rowid as rowid_0_
from
MVNO.LOG_TRANSACTION_PROFILE profiletra0_
where
profiletra0_.LOG_TRANSACTION_ID=?
13:37:51,434 WARN [JDBCExceptionReporter] SQL Error: 1000, SQLState: 72000
13:37:51,434 ERROR [JDBCExceptionReporter] ORA-01000: maximum open cursors exceeded
13:37:51,434 INFO [DefaultLoadEventListener] Error performing load command
org.hibernate.exception.GenericJDBCException: could not load an entity: [com.widerthan.rbt.model.data.ProfileTransactionLog#13544]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1799)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:47)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:41)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:799)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:792)
at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:452)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:446)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:440)
at com.widerthan.rbt.dao.hibernate.BaseHibernateDAO.getById(BaseHibernateDAO.java:152)
at com.widerthan.rbt.dao.hibernate.BaseHibernateDAO.getById(BaseHibernateDAO.java:129)
at com.widerthan.rbt.dao.hibernate.ProfileTransactionLogDAOTest$1.run(ProfileTransactionLogDAOTest.java:33)
at com.widerthan.rbt.TestEventImpl.runInTransaction(TestEventImpl.java:21)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:88)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy1.runInTransaction(Unknown Source)
at com.widerthan.rbt.BaseTestCase.runInTransaction(BaseTestCase.java:175)
at com.widerthan.rbt.dao.hibernate.ProfileTransactionLogDAOTest.update(ProfileTransactionLogDAOTest.java:47)
at com.widerthan.rbt.dao.hibernate.ProfileTransactionLogDAOTest.testVolume(ProfileTransactionLogDAOTest.java:23)
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:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at junit.textui.TestRunner.doRun(TestRunner.java:115)
at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:58)
at junit.textui.TestRunner.start(TestRunner.java:179)
at com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
at com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:98)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
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: java.sql.SQLException: ORA-01000: maximum open cursors exceeded
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
... 57 more
13:37:51,574 INFO [DriverManagerConnectionProvider] cleaning up connection pool: jdbc:oracle:thin:@10.10.50.234:1521:CRBDEV1
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not load an entity: [com.widerthan.rbt.model.data.ProfileTransactionLog#13544]; uncategorized SQLException for SQL [/* load com.widerthan.rbt.model.data.ProfileTransactionLog */ select profiletra0_.LOG_TRANSACTION_ID as LOG1_21_0_, profiletra0_.VERSION as VERSION21_0_, profiletra0_.CUSTOMER_NAME as CUSTOMER3_21_0_, profiletra0_.REQUEST_TRANSACTION_ID as REQUEST4_21_0_, profiletra0_.REQUEST_OPERATOR_ID as REQUEST5_21_0_, profiletra0_.TRANSACTION_TYPE_ID as TRANSACT6_21_0_, profiletra0_.SERVICE_CHANNEL_ID as SERVICE7_21_0_, profiletra0_.USER_MSISDN as USER8_21_0_, profiletra0_.DESCRIPTION as DESCRIPT9_21_0_, profiletra0_.BILLING_TRANSACTION_ID as BILLING10_21_0_, profiletra0_.PRICE as PRICE21_0_, profiletra0_.EXT_TRANSACTION_ID as EXT12_21_0_, profiletra0_.SERVICE_NAME as SERVICE13_21_0_, profiletra0_.STATUS as STATUS21_0_, profiletra0_.PROCESSING_TIME as PROCESSING15_21_0_, profiletra0_.EXT_PROCESSING_TIME as EXT16_21_0_, profiletra0_.LOGGED as LOGGED21_0_, profiletra0_.USER_ID as USER18_21_0_, profiletra0_.CUSTOMER_ID as CUSTOMER19_21_0_, profiletra0_.rowid as rowid_0_ from MVNO.LOG_TRANSACTION_PROFILE profiletra0_ where profiletra0_.LOG_TRANSACTION_ID=?]; SQL state [72000]; error code [1000]; ORA-01000: maximum open cursors exceeded
; nested exception is java.sql.SQLException: ORA-01000: maximum open cursors exceeded
java.sql.SQLException: ORA-01000: maximum open cursors exceeded
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:47)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:41)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:799)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:792)
at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:452)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:446)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:440)
at com.widerthan.rbt.dao.hibernate.BaseHibernateDAO.getById(BaseHibernateDAO.java:152)
at com.widerthan.rbt.dao.hibernate.BaseHibernateDAO.getById(BaseHibernateDAO.java:129)
at com.widerthan.rbt.dao.hibernate.ProfileTransactionLogDAOTest$1.run(ProfileTransactionLogDAOTest.java:33)
at com.widerthan.rbt.TestEventImpl.runInTransaction(TestEventImpl.java:21)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:88)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy1.runInTransaction(Unknown Source)
at com.widerthan.rbt.BaseTestCase.runInTransaction(BaseTestCase.java:175)
at com.widerthan.rbt.dao.hibernate.ProfileTransactionLogDAOTest.update(ProfileTransactionLogDAOTest.java:47)
at com.widerthan.rbt.dao.hibernate.ProfileTransactionLogDAOTest.testVolume(ProfileTransactionLogDAOTest.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-2027) ComponentType.replace reverts interceptor's changes to null component
by Josh Moore (JIRA)
ComponentType.replace reverts interceptor's changes to null component
---------------------------------------------------------------------
Key: HHH-2027
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2027
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr2
Environment: Hibernate r10347
java version "1.5.0_07"
Reporter: Josh Moore
Attachments: nullcomponentinterceptor.zip
When an interceptor sets a previously null component-typed property of an entity to a non-null value, ComponentType.replace reverts the value to null due to the lines 422-425:
if ( original == null ) {
return null;
}
This means it is not possible on Interceptor.onSave() to "fix" a null component even if true is returned. Excerpts from the attached zip file follow:
[MAPPING]
<class name="Image" table="image" abstract="false" select-before-update="true">
<id name="id" type="java.lang.Long" column="id"><generator class="native"/></id>
<component name="details" class="Details">
<property name="perm1" not-null="true"
type="long" column="permissions"/>
</component>
<property name="name" type="java.lang.String" column="name" not-null="true" length="256"/>
</class>
[INTERCEPTOR]
public class DetailsInterceptor extends EmptyInterceptor {
boolean onSaveCalled = false;
@Override
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
state[0] = new Details();
onSaveCalled = true;
return true;
}
}
[TEST]
DetailsInterceptor pi = new DetailsInterceptor();
Session s = openSession( pi );
Transaction t = s.beginTransaction();
Image i = new Image();
i.setName("compincomp");
// the interceptor does the equivalent of:
//
// i.setDetails( new Details() );
//
// which when uncommented makes this test pass.
//
// without that line, the null details gets copied back to the result
// on merge causing the following on commit:
/*
org.hibernate.PropertyValueException: not-null property references a null or transient value: org.hibernate.test.compincomp.Image.details
at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
at org.hibernate.event.def.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:263)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:121)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
*/
s.merge(i);
assertTrue( pi.onSaveCalled );
t.commit();
s.close();
--
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
18 years, 1 month
[Hibernate-JIRA] Created: (HHH-1982) Merge doesnt work with composite keys
by Jara Cesnek (JIRA)
Merge doesnt work with composite keys
-------------------------------------
Key: HHH-1982
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1982
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3
Reporter: Jara Cesnek
Merge() operation as defined in JSR220 works fine with our entities with simple keys.
But on tables with composite keys same doesnt works.
Hibernate always try insert into table even when should only update.
@IdClass(DOGaa_smlouva_dodatek.DOGaa_smlouva_dodatekPk.class)
@MappedSuperclass
public abstract class DOGaa_smlouva_dodatek {
@Id
protected Integer id_pripad;
@Id
protected Integer pc_smlouva_dodatek;
@Embeddable
public static class DOGaa_smlouva_dodatekPk implements Serializable {
protected Integer id_pripad;
public Integer getId_pripad() {
return id_pripad;
}
public void setId_pripad(Integer id_pripad) {
this.id_pripad = id_pripad;
}
protected Integer pc_smlouva_dodatek;
public Integer getPc_smlouva_dodatek() {
return pc_smlouva_dodatek;
}
public void setPc_smlouva_dodatek(Integer pc_smlouva_dodatek) {
this.pc_smlouva_dodatek = pc_smlouva_dodatek;
}
public boolean equals(Object other){
if ( !(other instanceof DOGaa_smlouva_dodatekPk) ) {return false;}
DOGaa_smlouva_dodatekPk castOther = (DOGaa_smlouva_dodatekPk) other;
return new EqualsBuilder()
.append(id_pripad,castOther.id_pripad)
.append(pc_smlouva_dodatek,castOther.pc_smlouva_dodatek)
.isEquals();
}
public int hashCode() {
return new HashCodeBuilder()
.append(id_pripad)
.append(pc_smlouva_dodatek)
.toHashCode();
}
}
}
Second thing is when we try delete entity through merge on composite keys:
doAttach = (DOParent) hao.getHibernateTemplate().merge(doDetach);
hao.getHibernateTemplate().delete(doAttach);
hibernate try first insert too and then delete.
When entity has simple key this code work fine.
--
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
18 years, 2 months
[Hibernate-JIRA] Created: (HHH-2023) Hibernate 3.2 not working under WebSphere 6.0.2
by Andrei Iltchenko (JIRA)
Hibernate 3.2 not working under WebSphere 6.0.2
-----------------------------------------------
Key: HHH-2023
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2023
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr2
Environment: 1) WebSphere Application Server 6.0.2.9, Base
2) Hibernate version: 3.2.CR2
3) Oracle 10g
4) Driver Oracle 10g XA thin driver (Managed Connection)
5) SessionFacade with a transactional attribute Requires
Reporter: Andrei Iltchenko
Priority: Blocker
I am getting the following exception when I try to use Hibernate on WebSphere 6.0.2.9 in a business method of a CMT SLSB. The exception occurs when I call 'session.beginTransaction()':
org.hibernate.TransactionException: Could not find UserTransaction in JNDI:
at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:64)
at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:57)
at org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java:186)
at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1308)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1318)
at rootpackage.application.business.logic.ServiceAgreementSvcBean.storeServiceAgreement(ServiceAgreementSvcBean.java:832)
... 37 more
Caused by: javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1094)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:990)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:201)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:142)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:60)
My SessionFactory configuration file looks as follows:
<session-factory name="java:hibernate/RootpackageEntitySessionFactory">
<!-- DBMS dialect: oracle. -->
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.datasource">jdbc/optimalj5</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
<!-- Cache manager -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<!-- Mapping files for entity module: -->
...
</session-factory>
adding additional configuration options as suggested in <http://opensource.atlassian.com/projects/hibernate/browse/HHH-198>
<property name="hibernate.transaction.flush_before_completion">true</property>
<property name="hibernate.transaction.auto_close_session">true</property>
causes the exception to be thrown at a time when I call openSession() on a SessionFactory instance:
Exception data: org.hibernate.TransactionException: Unable to locate UserTransaction to check status
at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:86)
at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:180)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:158)
at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:75)
at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:215)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:470)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:494)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:502)
at rootpackage.application.business.logic.ServiceAgreementSvcBean.retrieveAll(ServiceAgreementSvcBean.java:1584)
at rootpackage.application.business.logic.EJSRemoteStatelessServiceAgreementSvc_10611836.retrieveAll(Unknown Source)
at rootpackage.application.business.logic._ServiceAgreementSvc_Stub.retrieveAll(_ServiceAgreementSvc_Stub.java:799)
at rootpackage.application.business.facade.ServiceAgreementSvcServiceAgreementBusinessFacade.retrieveAll(ServiceAgreementSvcServiceAgreementBusinessFacade.java:1980)
at rootpackage.application.business.facade.ServiceAgreementSvcServiceAgreementBusinessFacade.retrieveAll(ServiceAgreementSvcServiceAgreementBusinessFacade.java:1948)
at rootpackage.application.presentation.ServiceAgreementSvcAction.invokeRetrieveAll(ServiceAgreementSvcAction.java:226)
at rootpackage.application.presentation.ServiceAgreementSvcRetrieveAction.handleRetrieveAll(ServiceAgreementSvcRetrieveAction.java:144)
at rootpackage.application.presentation.ServiceAgreementSvcRetrieveAction.retrieve(ServiceAgreementSvcRetrieveAction.java:247)
at rootpackage.application.presentation.ServiceAgreementSvcRetrieveAction.execute(ServiceAgreementSvcRetrieveAction.java:87)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1239)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:670)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:322)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1239)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:136)
at rootpackage.application.presentation.filters.SetCharacterEncodingFilterRootpackageWeb.doFilter(SetCharacterEncodingFilterRootpackageWeb.java:139)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:670)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2965)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:221)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1931)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Forum reference: <http://forum.hibernate.org/viewtopic.php?t=963579>
--
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
18 years, 2 months