[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
17 years, 4 months
[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
17 years, 5 months
[Hibernate-JIRA] Created: (EJB-229) merge fails with detached obj in 1:1 relationship
by Juergen Zimmermann (JIRA)
merge fails with detached obj in 1:1 relationship
-------------------------------------------------
Key: EJB-229
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-229
Project: Hibernate Entity Manager
Type: Bug
Components: EntityManager
Versions: 3.2.0.cr2
Environment: JBoss 4.0.5CR1, Hibernate 3.2.0CR4, Hibernate EntityManager 3.2.0CR2, PostgreSQL 8.1.4, JDK 1.5.0_08
Reporter: Juergen Zimmermann
I'm using Hibernate EntityManager 3.2CR2 inside JBoss EJB3 CR9.
I'm invoking em.merge() with a detached object. The detached object has a 1:1 relationship with another detached object. The fetch strategy is the default strategy for 1:1 relationships. However, merge() fails and yields the stack trace below.
When I enforce loading the referenced (and also detached) object, e.g. by em.find(), then there is no problem in invoking merge() afterwards.
javax.ejb.EJBException: java.lang.ClassCastException: de.hska.kundenverwaltung.db.Firmenkunde
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:167)
at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:108)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:412)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
Caused by: java.lang.ClassCastException: de.hska.kundenverwaltung.db.Firmenkunde
at org.hibernate.type.LongType.set(LongType.java:42)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1513)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1575)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1784)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
at org.hibernate.loader.entity.EntityLoader.loadByUniqueKey(EntityLoader.java:85)
at org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:1581)
at org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:365)
at org.hibernate.type.EntityType.resolve(EntityType.java:306)
at org.hibernate.type.EntityType.replace(EntityType.java:207)
at org.hibernate.type.TypeFactory.replace(TypeFactory.java:437)
at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:340)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:267)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:120)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Created: (EJB-226) JarVistor.getVisitor does not handle paths containing spaces correctly for an exploded par
by Michael Falco (JIRA)
JarVistor.getVisitor does not handle paths containing spaces correctly for an exploded par
------------------------------------------------------------------------------------------
Key: EJB-226
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-226
Project: Hibernate Entity Manager
Type: Bug
Components: EntityManager
Versions: 3.2.0.cr2
Environment: Hibernate 3.2.0, Hibernate Annotations 3.2.0.cr2 on Windows XP
Reporter: Michael Falco
I found from the JIRA database that EJB-178 and EJB-181 were written regarding the issue of the Entity Manager not handling paths with spaces in them correctly, and they both are in the 'resolved' state. However, in 3.2.0.cr2 of the EntityManager, I still get this error when running the PackagedEntityManagerTest testExplodedPar JUnit test from a root directory that contains spaces:
12:20:34,331 DEBUG JarVisitor:192 - Searching mapped entities in jar/par: file:/D:/User%20Data/Eclipse_Workspaces/Test/HibernateEntityManagerTest/build/testresources/explodedpar.par
12:20:34,346 WARN FileZippedJarVisitor:37 - Unable to find file (ignored): file:/D:/User%20Data/Eclipse_Workspaces/Test/HibernateEntityManagerTest/build/testresources/explodedpar.par
java.util.zip.ZipException: Access is denied
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:203)
at java.util.jar.JarFile.<init>(JarFile.java:132)
at java.util.jar.JarFile.<init>(JarFile.java:70)
at org.hibernate.ejb.packaging.FileZippedJarVisitor.doProcessElements(FileZippedJarVisitor.java:34)
at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:215)
at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:251)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:227)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at org.hibernate.ejb.test.PackagedEntityManagerTest.testExplodedPar(PackagedEntityManagerTest.java:110)
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 junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
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)
After looking at the EJB-178 and EJB-181 errors and the code, it appears that what happened was that EJB-178 was closed as a duplicate of EJB-181, but they are not the same error. It is the same jarUrl.getFile() call that causes the problem, but it is in different code: EJB-178 covers the org.hibernate.ejb.packaging.JarVisitor.getVisitor() method, whereas EJB-181 covers the org.hibernate.ejb.packaging.ExplodedJarVisitor.doProcessElements() .
The source code shows that EJB-181 was fixed but EJB-178 was not. I put the fix in to the JarVisitor.getVisitor() method (changed jar Url.getFile() to jarUrl.toURI().getSchemeSpecificPart() and added exception handling) and rebuilt the Entity Manager jar. I then reran the PackagedEntityManagerTest testExplodedPar JUnit test using the new jar, and the JUnit passed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Created: (HHH-2108) org.hibernate.MappingNotFoundException: file:
by Courtney Arnold (JIRA)
org.hibernate.MappingNotFoundException: file:
----------------------------------------------
Key: HHH-2108
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2108
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr4
Environment: Hibernate 3.2.0cr4, SQL Server 2000
Reporter: Courtney Arnold
I receive the following error while trying to add a cacheable configuration file to the configuration:
org.hibernate.InvalidMappingException: Could not parse mapping document from file F:\products\common\resources\hibernate\hbm\org\waterford\product\data\db\hibernate\Product.hbm.xml
at org.hibernate.cfg.Configuration.addCacheableFile(Configuration.java:359)
at org.hibernate.cfg.Configuration.addCacheableFile(Configuration.java:364)
at org.waterford.common.data.db.hibernate.HibernateDbBroker._addMappings(HibernateDbBroker.java:568)
at org.waterford.common.data.db.hibernate.HibernateDbBroker._getConfiguration(HibernateDbBroker.java:477)
at org.waterford.common.data.db.hibernate.HibernateDbBroker._initSessionFactory(HibernateDbBroker.java:668)
at org.waterford.common.data.db.hibernate.HibernateDbBroker.setDb(HibernateDbBroker.java:189)
at org.waterford.sm.db.smdbinterface.HibSmDbInterface.connect(HibSmDbInterface.java:426)
at org.waterford.sm.db.smdbinterface.HibSmDbInterface.<init>(HibSmDbInterface.java:333)
at org.waterford.sm.db.smdbinterface.factory.HibSmDbInterfaceFactory._getInstance(HibSmDbInterfaceFactory.java:51)
at org.waterford.sm.db.smdbinterface.factory.HibSmDbInterfaceFactory.getInstance(HibSmDbInterfaceFactory.java:24)
at org.waterford.sm.license.LicenseManager._getDbInterface(LicenseManager.java:48)
at org.waterford.sm.license.LicenseManager.loadFromDB(LicenseManager.java:218)
at org.waterford.sm.license.LicenseManager.init(LicenseManager.java:183)
at org.waterford.sm.license.LicenseManager.initLicensing(LicenseManager.java:118)
at org.waterford.sm.SMFrame.init(SMFrame.java:284)
at org.waterford.sm.SMApp.<init>(SMApp.java:76)
at org.waterford.sm.SMApp.main(SMApp.java:213)
Caused by: org.hibernate.MappingNotFoundException: file: F:\products\common\resources\hibernate\hbm\org\waterford\product\data\db\hibernate\Product.hbm.xml not found
at org.hibernate.cfg.Configuration.addCacheableFile(Configuration.java:349)
... 16 more
I have looked at the source for org.hibernate.cfg.Configuration(addCacheableFile) and the problem lies in the if /else statement around line 348. Prior to this statement a cached configuration file was loaded into the "doc" object. So the if statement "if (doc == null && xmlFile.exists())" will return false. Doing so, execution continues on the else statement that executes "throw new MappingNotFoundException("file", xmlFile.toString());". Due to this, no cached files can be loaded into the configuration, only uncached files can be loaded. The else statement needs to be modified to be "else if (doc == null)".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 5 months
[Hibernate-JIRA] Created: (HHH-2082) UpdateTimestampsCache.isUpToDate returns before checking all spaces
by Anders Wallgren (JIRA)
UpdateTimestampsCache.isUpToDate returns before checking all spaces
-------------------------------------------------------------------
Key: HHH-2082
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2082
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr4
Environment: 3.2.0.cr4, MySQL 5.0.24a
Reporter: Anders Wallgren
Priority: Blocker
Seems like a bug was recently (since cr1?) introduced in isUpToDate:
public synchronized boolean isUpToDate(Set spaces, Long timestamp) throws HibernateException {
Iterator iter = spaces.iterator();
while ( iter.hasNext() ) {
Serializable space = (Serializable) iter.next();
Long lastUpdate = (Long) updateTimestamps.get(space);
if ( lastUpdate==null ) {
//the last update timestamp was lost from the cache
//(or there were no updates since startup!)
//updateTimestamps.put( space, new Long( updateTimestamps.nextTimestamp() ) );
//result = false; // safer
}
else {
if ( log.isDebugEnabled() ) {
log.debug("[" + space + "] last update timestamp: " + lastUpdate + ", result set timestamp: " + timestamp );
}
#
# This statement returns without checking the other spaces. The old (commented out) code seems correct to me.
#
return lastUpdate.longValue() < timestamp.longValue();
// if ( lastUpdate.longValue() >= timestamp.longValue() ) return false;
#
#
#
}
}
return true;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 5 months