[Hibernate-JIRA] Created: (HHH-3647) instance not of expected entity type: java.util.HashMap is not a: smx3.schema3.Party_AUD
by Mark Derricutt (JIRA)
instance not of expected entity type: java.util.HashMap is not a: smx3.schema3.Party_AUD
----------------------------------------------------------------------------------------
Key: HHH-3647
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3647
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.4
Reporter: Mark Derricutt
After resolving all my other issues regarding using envers from trunk, I now find this stacktrace thrown when saving records into the database:
org.hibernate.HibernateException: instance not of expected entity type: java.util.HashMap is not a: smx3.schema3.Party_AUD
at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassEntityPersister(AbstractEntityPersister.java:3663)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1374)
at org.hibernate.id.Assigned.generate(Assigned.java:51)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:562)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:550)
at org.hibernate.envers.synchronization.work.ModWorkUnit.perform(ModWorkUnit.java:59)
at org.hibernate.envers.synchronization.AuditSync.executeInSession(AuditSync.java:126)
at org.hibernate.envers.synchronization.AuditSync.beforeCompletion(AuditSync.java:150)
at com.atomikos.icatch.jta.Sync2Sync.beforeCompletion(Sync2Sync.java:73)
at com.atomikos.icatch.imp.TransactionStateHandler.commit(TransactionStateHandler.java:253)
at com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:509)
at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:138)
at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:297)
at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:608)
at com.atomikos.icatch.jta.UserTransactionManager.commit(UserTransactionManager.java:148)
at nz.co.smx.rest.TransactionFilter.afterHandle(TransactionFilter.java:224)
at org.restlet.Filter.handle(Filter.java:197)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Filter.doHandle(Filter.java:150)
at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:130)
at org.restlet.Filter.handle(Filter.java:195)
at org.restlet.Filter.doHandle(Filter.java:150)
at org.restlet.Filter.handle(Filter.java:195)
at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124)
at com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:112)
at org.restlet.Application.handle(Application.java:341)
at org.restlet.ext.wadl.WadlApplication.handle(WadlApplication.java:705)
at org.restlet.Filter.doHandle(Filter.java:150)
My Party entity is a single table inheritance based entity with three subclasses.
--
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
15 years, 12 months
[Hibernate-JIRA] Created: (HHH-3679) Sybase conversion of Java byte to tinyint fails with 8-bit values causing unit test failures
by Gail Badner (JIRA)
Sybase conversion of Java byte to tinyint fails with 8-bit values causing unit test failures
--------------------------------------------------------------------------------------------
Key: HHH-3679
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3679
Project: Hibernate Core
Issue Type: Bug
Environment: Sybase
Reporter: Gail Badner
Assignee: Gail Badner
Fix For: 3.2.x, 3.3.x, 3.4
If an 8-bit byte value is inserted into a Sybase TINYINT column, GenericJDBCException is thrown because of an arithmetic overflow during implicit conversion of a SMALLINT value to a TINYINT field.
This is happening for MixedTest.testMixedInheritance() and InterfaceProxyTest.testInterfaceProxies().
The full stacktrace is:
could not insert: [org.hibernate.test.interfaceproxy.SecureDocumentImpl]" type="org.hibernate.exception.
GenericJDBCException">org.hibernate.exception.GenericJDBCException: could not insert: [org.hibernate.test.interfaceproxy.Sec
ureDocumentImpl]
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.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2640)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventL
istener.java:187)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:
172)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at org.hibernate.test.interfaceproxy.InterfaceProxyTest.testInterfaceProxies(InterfaceProxyTest.java:52)
at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:102)
at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34)
at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100)
at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)
Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Arithmetic overflow during implicit conversion of SMALLINT value '-10
4' to a TINYINT field .
at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.updateLoop(Unknown Source)
at com.sybase.jdbc3.jdbc.SybStatement.executeUpdate(Unknown Source)
at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeUpdate(Unknown Source)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2250)
... 34 more
--
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
15 years, 12 months
[Hibernate-JIRA] Created: (HHH-3675) Limitiations on Sybase ResultSet implementation causes unit tets failures
by Gail Badner (JIRA)
Limitiations on Sybase ResultSet implementation causes unit tets failures
-------------------------------------------------------------------------
Key: HHH-3675
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3675
Project: Hibernate Core
Issue Type: Bug
Components: core
Reporter: Gail Badner
Assignee: Gail Badner
Fix For: 3.2.x, 3.3.x, 3.4
CMTTest.testCurrentSessionWithScroll() fails using Sybase because it calls ResultSet.isLast() and the Sybase implentation throws com.sybase.jdbc2.utils.UnimplementedOperationException. The exception message is, "The method com.sybase.jdbc2.jdbc.SybResultSet.isLast() has not been completed and should not be called.".
AggressiveReleaseTest,testSerializationFailsOnAfterStatementAggressiveReleaseWithOpenResources() throws NullPointerException when a ResultSet is closed before reading any rows.
The exception is:
java.lang.NullPointerException at com.sybase.jdbc2.tds.TdsResultSet.next(TdsResultSet.java:313) at com.sybase.jdbc2.tds.TdsResultSet.close(TdsResultSet.java:452) at com.sybase.jdbc2.jdbc.SybResultSet.markDead(SybResultSet.java:1540) at com.sybase.jdbc2.jdbc.SybResultSet.close(SybResultSet.java:1608) at com.sybase.jdbc2.jdbc.SybResultSet.close(SybResultSet.java:193) at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:207) at org.hibernate.impl.AbstractScrollableResults.close(AbstractScrollableResults.java:99) at org.hibernate.test.connections.AggressiveReleaseTest.testSerializationFailsOnAfterStatementAggressiveReleaseWithOpenResources(AggressiveReleaseTest.java:112) at org.hibernate.junit.functional.FunctionalTestCase.runTest(FunctionalTestCase.java:102) at org.hibernate.junit.UnitTestCase.runBare(UnitTestCase.java:34) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.runTest(FunctionalTestClassTestSuite.java:100) at org.hibernate.junit.functional.FunctionalTestClassTestSuite.run(FunctionalTestClassTestSuite.java:69)
CurrentSessionConnectionTest extends AggressiveReleaseTest, so NullPointerException is thrown for the same reason.
--
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
15 years, 12 months
[Hibernate-JIRA] Created: (HHH-3678) Fields marked as @Transient on components that are mapped on @CollecionOfElements are still persistent
by Leandro Feres Ribeiro (JIRA)
Fields marked as @Transient on components that are mapped on @CollecionOfElements are still persistent
------------------------------------------------------------------------------------------------------
Key: HHH-3678
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3678
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6.GA, hibernate-commons-annotations 3.3.0.GA, hibernate-annotations 3.3.0.GA.
Reporter: Leandro Feres Ribeiro
Attachments: testCase.zip
The test cases show the bug. I have a Component class, that is an attribute of the CollectionElement class, that is mapped as a @CollectionOfElements on TestEntity. Component has 4 transient attributes (name, description, middleName and lastName), however only middleName and lastName behave as transient. This means that when the @Transient annotation appears on the getter methods, on the Component class, it is not working.
See the classes below:
public class Component implements Serializable {
private Integer id;
private String name;
private String description;
@Transient
private String middleName;
private transient String lastName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Transient
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Transient
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMiddleName() {
return middleName;
}
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
public class CollectionElement implements Serializable {
private Component component;
private Integer number;
private String property;
public Component getComponent() {
return component;
}
public void setComponent(Component component) {
this.component = component;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getProperty() {
return property;
}
public void setProperty(String property) {
this.property = property;
}
}
@Entity
@Table
public class TestEntity {
private Integer id;
private List<CollectionElement> elements = new ArrayList<CollectionElement>();
@Id
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@CollectionOfElements
public List<CollectionElement> getElements() {
return elements;
}
public void setElements(List<CollectionElement> elements) {
this.elements = elements;
}
}
--
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
16 years
[Hibernate-JIRA] Created: (HHH-3676) Unable to Load JTA Transaction
by pioneer (JIRA)
Unable to Load JTA Transaction
------------------------------
Key: HHH-3676
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3676
Project: Hibernate Core
Issue Type: Bug
Components: core
Environment: Hibernate3, Weblogic 9.0
Reporter: pioneer
This is my hibernat.cfg.xml file which i have been using for my app. me trying out an J2ee Application within an weblogic 9.0 . As my config denotes its exactly true.When WeblogicTransactionManagerLookup tries to look out for tranaction within JTASessionContext within currentSession() method , it returns due to the following line.
if(txn == null)
{
throw new HibernateException("Unable to load JTA Transaction);
}
this line didn't allow to proceed within the method to create an new session. Its an bug with JTASessionContext. Correct me if iam wrong.
<property name="connection.datasource">jdbc/connectionPool</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.current_session_context_class">jta</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
<property name="show_sql">true</property>
--
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
16 years
[Hibernate-JIRA] Created: (HHH-3303) Parameters bound in wrong order for IN-clauses on dynamic components
by Holger Engels (JIRA)
Parameters bound in wrong order for IN-clauses on dynamic components
--------------------------------------------------------------------
Key: HHH-3303
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3303
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.6
Reporter: Holger Engels
When issuing the following query, the parameters are bound in wrong order:
List<Map> keys = Arrays.asList(CollectionUtil.map("mandator", "M", "key", "test"), CollectionUtil.map("mandator", "M", "key", "user"));
list = session.createCriteria(Profile.class).add(Restrictions.in("key", keys)).list();
// list.size() = 0, should be 2
[DEBUG] 15:24:45 [org.hibernate.SQL ]: select this_.id as id7_0_, this_.version as version7_0_, this_.key_mandator as key3_7_0_, this_.key_key as key4_7_0_, this_.created as created7_0_, this_.createdBy as createdBy7_0_, this_.modified as modified7_0_, this_.name as name7_0_ from auth_profile this_ where (this_.key_mandator, this_.key_key) in ((?, ?), (?, ?))
Hibernate: select this_.id as id7_0_, this_.version as version7_0_, this_.key_mandator as key3_7_0_, this_.key_key as key4_7_0_, this_.created as created7_0_, this_.createdBy as createdBy7_0_, this_.modified as modified7_0_, this_.name as name7_0_ from auth_profile this_ where (this_.key_mandator, this_.key_key) in ((?, ?), (?, ?))
[DEBUG] 15:24:45 [nate.jdbc.AbstractBatcher]: preparing statement
[DEBUG] 15:24:45 [hibernate.type.StringType]: binding 'M' to parameter: 1
[DEBUG] 15:24:45 [hibernate.type.StringType]: binding 'M' to parameter: 2
[DEBUG] 15:24:45 [hibernate.type.StringType]: binding 'test' to parameter: 3
[DEBUG] 15:24:45 [hibernate.type.StringType]: binding 'user' to parameter: 4
It should be:
binding 'M' to parameter: 1
binding 'test' to parameter: 2
binding 'M' to parameter: 3
binding 'user' to parameter: 4
The mapping for key is:
<dynamic-component name="key" unique="true">
<property name="mandator" column="key_mandator" type="string" length="4"/>
<property name="key" column="key_key" type="string" length="16"/>
</dynamic-component>
Interestingly, the same query works in HQL:
Query query = session.createQuery("from Profile where key in (:keys)");
query.setParameterList("keys", keys);
list = query.list();
// list.size() = 2
--
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
16 years