[Hibernate-JIRA] Created: (HHH-3111) WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus() implemented incorrect
by Felix von Delius (JIRA)
WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus() implemented incorrect
-------------------------------------------------------------------------------------------------
Key: HHH-3111
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3111
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6, 3.2.5
Environment: Hibernate-3.2.6, Oracle 9i, IBM WebSphere 6.0.2.17 using JTATransactions
Reporter: Felix von Delius
Priority: Critical
In our in-container-configuration (WebSphere 6.0.2.x), we get the following Exception since moving from Hibernate 3.1.3 to 3.2.6 (Problem also occurs with 3.2.5):
Caused by: com.ing.diba.mws.tcore.exception.logging.ConvertedException: org.hibernate.TransactionException: could not register synchronization with JTA Transa
ctionManager [Error code: MWS-6001: "Technischer Fehler"]
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:185)
at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:76)
at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:213)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:473)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:497)
at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:505)
at com.ing.diba.mws.tcore.persistence.HibernateSessionSourceImpl.createPersistenceProvider(HibernateSessionSourceImpl.java:45)
...removed irrelevant lines...
at com.ing.diba.mws.tcore.service.remoting.ejb.EJSLocalStatelessRemoteInvoker_d8103d48.invoke(Unknown Source)
at com.ing.diba.mws.tcore.service.remoting.RemotingInterceptorLocalEJB.invoke(RemotingInterceptorLocalEJB.java:90)
... 57 more
Caused by: java.lang.UnsupportedOperationException
at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.getStatus(WebSphereExtendedJTATransactionLookup.java:87)
at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:94)
at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:191)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:159)
... 154 more
Our hibernate configuration contains the following settings:
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
It seems that getStatus() of the inner class TransactionManagerAdapter is invoked and throws the UnsupportedOperationException. Instead of doing that, it probably should delegate to the getStatus() method of the inner-inner class TransactionAdapter like this:
public int getStatus() throws SystemException {
return getTransaction().getStatus();
}
At least after patching that in Hibernate-3.2.6 and deploying the patched hibernate3.jar, the problem disappeared.
--
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, 11 months
[Hibernate-JIRA] Created: (HBX-1064) hibernate.hbm2ddl.auto=update skip a superclass table creation
by Bartolomeo Romano (JIRA)
hibernate.hbm2ddl.auto=update skip a superclass table creation
--------------------------------------------------------------
Key: HBX-1064
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1064
Project: Hibernate Tools
Issue Type: Bug
Components: eclipse
Environment: Spring, Postgres 8.1.4, Hibernate 3.2.0 cr2
Reporter: Bartolomeo Romano
hbm2ddl=auto doesn't create a table with the same name of another table wich already exist in the DB but on an another Schema.
The wierd thing is that it does create that table on another (a third) schema.
Looking the log it seems that hibernate doesn't even notice there is that table to create even if when it resolves the references for the classes it sees the class.
This is the class not created:
<hibernate-mapping auto-import="false" default-lazy="false" schema="trackmatch" >
<class name="com.unique.trackmatch.security.GroupRoles" table="group_roles">
<id name="id">
<column name="id" sql-type="char(32)" not-null="true" unique="true"/>
<generator class="uuid.hex"/>
</id>
<set name="trackMatchManagerGroups" table="trackmatch_manager_groups">
<key>
<column name="group_roles_id" sql-type="char(32)"/>
</key>
<many-to-many class="com.unique.cmf.user.Group">
<column name="group_id" sql-type="char(32)"/>
</many-to-many>
</set>
</class>
</hibernate-mapping>
The other table has the same name but it's in a different schema of the same DataBase
This is the log I get:
19:02:00,250 [main] DEBUG SchemaUpdate.debug() - create table trackmatch.trackmatch_manager_groups (group_roles_id char(32) not null, group_id char(32) not null, primary key (group_roles_id, group_id))
19:02:00,265 [main] DEBUG SchemaUpdate.debug() - alter table trackmatch.trackmatch_manager_groups add constraint FKF887CA2BC81D8925 foreign key (group_roles_id) references trackmatch.group_roles
19:02:00,265 [main] ERROR SchemaUpdate.error() - Unsuccessful: alter table trackmatch.trackmatch_manager_groups add constraint FKF887CA2BC81D8925 foreign key (group_roles_id) references trackmatch.group_roles
19:02:00,281 [main] ERROR SchemaUpdate.error() - ERROR: relation "trackmatch.group_roles" does not exist
19:02:00,281 [main] DEBUG SchemaUpdate.debug() - alter table trackmatch.trackmatch_manager_groups add constraint FKF887CA2B84BBA459 foreign key (group_id) references usergroup.groups
At the end it creates the class defined in the <set> but not the super class nor the foreign.
If I change the table's name it works 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
15 years, 11 months
[Hibernate-JIRA] Created: (ANN-725) @OneToOne: optional = true is ignored
by Adrian Moos (JIRA)
@OneToOne: optional = true is ignored
-------------------------------------
Key: ANN-725
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-725
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.3.0.ga
Environment: hibernate 3.2.4.sp1
Reporter: Adrian Moos
Priority: Minor
In some entity, I map:
@javax.persistence.OneToOne(targetEntity = InfoAutoVerrechnungImpl.class, fetch = FetchType.LAZY, //
optional = true)
@javax.persistence.JoinColumns(/**/{
@javax.persistence.JoinColumn(name = "MI0153A", referencedColumnName = "MI0153A", //
nullable = false, updatable = false, insertable = false),
@javax.persistence.JoinColumn(name = "MI1997A", referencedColumnName = "MI1997A", //
nullable = false, updatable = false, insertable = false) })
public InfoAutoVerrechnung getInfoAutoVerrechnung();
The optional = true is lost during construction of hibernate's configuration metamodel, as the property is represented using a ManyToOneType (!) with ignoreNotFound == false (and hence nullable == false). Consequently, hibernate installs a proxy for the property on entity load even if the remote end of the association does not exist (whose lazy initialization fails with an ObjectNotFoundException).
Expected behavior: Hibernate should either respect the optional = true, or throw a MappingException (ideally mentioning the expected way to express nullability).
Workaround: Adding
@NotFound(action = NotFoundAction.IGNORE)
causes hibernate to treat the property as nullable.
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-3043) Map in entities using @GenericGenerator(name="system-uuid", strategy = "uuid") doesn't work
by Pascal P. Pochet (JIRA)
Map in entities using @GenericGenerator(name="system-uuid", strategy = "uuid") doesn't work
-------------------------------------------------------------------------------------------
Key: HHH-3043
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3043
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Reporter: Pascal P. Pochet
Priority: Blocker
Attachments: Archive.zip
When using this entity declaration
@Id
@GeneratedValue
protected long id ;
@Type(type="language")
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
@MapKey(columns=@Column(name="language", length=6))
protected java.util.Map<Language,Label> itsLabels = new HashMap<Language,Label>() ;
reading back of persisted Label associated with the entity works ok
When changing to
@Id
@GenericGenerator(name="system-uuid", strategy = "uuid")
@Column(name="id", length=36)
protected String itsUUID = UUID.randomUUID().toString() ;
@Type(type="language")
@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
@MapKey(columns=@Column(name="language", length=6))
protected java.util.Map<Language,Label> itsLabels = new HashMap<Language,Label>() ;
persisted Label can't be retrieved anymore (the itsLabels Map is always empty) and persisting new version of existing labels generates duplicate errors (of course...).
Tracking down the problem shows that different code is executed when the LAZY loading the map is performed, the UUID-based version generating the reading of 4 times the same Collection (there were 3 Label persisted for the test entity) and as consequence the setter is not called leaving the Label Map empty (as initialized at constructor time)
Part of the debug trace :
[java] 17:43:03,090 DEBUG CollectionLoadContext:217 - 4 collections were found in result set for role: eu.cec.sanco.sanref.valuelist.Individual.itsLabels
[java] 17:43:03,091 DEBUG CollectionLoadContext:260 - collection fully initialized: [eu.cec.sanco.sanref.valuelist.Individual.itsLabels#ac7117a2-3c0c-4d40-90ba-3bef5a5c77eb]
[java] 17:43:03,091 DEBUG CollectionLoadContext:260 - collection fully initialized: [eu.cec.sanco.sanref.valuelist.Individual.itsLabels#ac7117a2-3c0c-4d40-90ba-3bef5a5c77eb]
[java] 17:43:03,092 DEBUG CollectionLoadContext:260 - collection fully initialized: [eu.cec.sanco.sanref.valuelist.Individual.itsLabels#ac7117a2-3c0c-4d40-90ba-3bef5a5c77eb]
[java] 17:43:03,092 DEBUG CollectionLoadContext:260 - collection fully initialized: [eu.cec.sanco.sanref.valuelist.Individual.itsLabels#ac7117a2-3c0c-4d40-90ba-3bef5a5c77eb]
[java] 17:43:03,093 DEBUG CollectionLoadContext:226 - 4 collections initialized for role: eu.cec.sanco.sanref.valuelist.Individual.itsLabels
[java] 17:43:03,093 DEBUG StatefulPersistenceContext:790 - initializing non-lazy collections
[java] 17:43:03,094 DEBUG Loader:2010 - done loading collection
while on the Long id-based entity we got :
[java] 18:09:27,800 DEBUG CollectionLoadContext:217 - 1 collections were found in result set for role: eu.cec.sanco.sanref.valuelist.Individual.itsLabels
[java] 18:09:27,801 DEBUG CollectionLoadContext:260 - collection fully initialized: [eu.cec.sanco.sanref.valuelist.Individual.itsLabels#299]
[java] 18:09:27,801 DEBUG CollectionLoadContext:226 - 1 collections initialized for role: eu.cec.sanco.sanref.valuelist.Individual.itsLabels
[java] 18:09:27,802 DEBUG StatefulPersistenceContext:790 - initializing non-lazy collections
[java] 18:09:27,802 DEBUG Loader:2010 - done loading collection
Also in the trace of the UUID-based version, we see that Hibernate recursively load the mapped entity (Label)
[java] 17:43:02,906 DEBUG Loader:1852 - loading entity: [eu.cec.sanco.sanref.Label#0199f151-44f7-4704-9f09-72a42527590c]
(one "loading entity" message per persisted Label...)
while this is not happening when running the "GeneratedValue" version.
NB
The problem is not related to the usage of the UserType Language, testing as been done by going back to a more basic <String,Label> map: the problem remains identical.
By stepping in the code, possible source of the problem may be related to the "hasRowId" returned value in the UUID-based version. (not 100% sure...)
The 2 log files attached in 1 zip show the differences when lazy loading the Label map.
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-2119) reloading a detached object with a collection fails
by Gregory Kotsaftis (JIRA)
reloading a detached object with a collection fails
---------------------------------------------------
Key: HHH-2119
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2119
Project: Hibernate3
Type: Bug
Versions: 3.1.3
Environment: Hibernate 3.1.3
firebird 1.5.3.4870 with Jaybird-2.1.0
java 1.5.0_07
Reporter: Gregory Kotsaftis
Hi,
1) I have a simple object <O> with a collection loaded and use <version> for both (no second level cache)
2) The object <O> is associated with session A, via <O> = load(CLASS, <ID>)
3) The session <A> is later closed because e.g. an exception occurs
4) Another session is opened later on, session B
5) If load(<O>, <ID>) is called an NonUniqueObjectException is thrown
(a different object with the same identifier value was already associated with the session)
6) If instead I use the session.refresh(<O>) no exception is thrown, the object is reloaded ok.
It seems this issue might be related with:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-511
but i cannot be sure.
Part of the stacktrace:
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [gr.metadata.orthomed.db.Patient#23]
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:132)
at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:202)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:169)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:770)
at gr.metadata.lib.hibernate.HibernateHelper.reloadObject(HibernateHelper.java:230)
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-3336) LIKE checks with component values
by Maxx (JIRA)
LIKE checks with component values
----------------------------------
Key: HHH-3336
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3336
Project: Hibernate3
Issue Type: Improvement
Components: query-hql
Affects Versions: 3.2.5
Environment: Hibernate 3.2.5
Oracle 10i
Reporter: Maxx
In the same way than a previous "issue" i.e. http://opensource.atlassian.com/projects/hibernate/browse/HHH-2826
it would be very helpful if the HQL translator would "explode" a LIKE instruction on each property of a component, rather than just using the equal "=".
Let's say a Person with a name property (component type "Name") and the corresponding HQL query:
... from Person p where p.name like ('Jo%n', 'Schm%')
This uses the "row value constructor" as described here: http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html#queryhq...
Currently, the resulting SQL is something like:
... from Person p where p.f_name = 'Jo%n' and p.l_name = 'Schm%'
which is wrong as we've lost the purpose of the wildcard '%'
=> In this case, it just won't return the good results, but when the properties (here f_name, l_name) are something other than a String/VARCHAR (e.g. an INTEGER) it sometimes throws an error (like: % is not a number) ..!
The expected translation would be something like:
... from Person p where p.f_name LIKE 'Jo%n' and p.l_name LIKE 'Schm%'
I personally faced this case as I have an enumeration (enum, Java5) representing a set of business values, each mapped to a single sql column; as I don't want to list the name of ALL component properties (they are numerous, and easily iterable - thanks to the enum) and the "row value constructor" syntax is much easier to use in this case.
--
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, 11 months
[Hibernate-JIRA] Created: (EJB-367) Duplicated result in query with Inner join
by rodrigo rosa (JIRA)
Duplicated result in query with Inner join
------------------------------------------
Key: EJB-367
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-367
Project: Hibernate Entity Manager
Issue Type: Bug
Environment: Hibernate 3.2, PostgreSql
Reporter: rodrigo rosa
The following query returns m.titulo equals to comunidade.titulo when they are diferent in database. It seems that Hibernate repeat the the value for column with same name.
results = newSession.createSQLQuery("select m.id, m.titulo, m.resumo,m.corpo, m.autor_id, comunidade.titulo, count(v.id) as votos from noticia m left join voto v on v.noticia_id=m.id inner join usuario w on w.id=m.autor_id left outer join comunidade on w.comunidade_id=comunidade.id "+filtro+" group by m.id, m.corpo, m.titulo, m.resumo, m.autor_id, comunidade.titulo order by votos desc").list();
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-2605) Since 3.2.4 no value specified for row id
by Igor A Tarasov (JIRA)
Since 3.2.4 no value specified for row id
-----------------------------------------
Key: HHH-2605
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2605
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4
Environment: hibernate-3.2.4
mysql-5.0.27-1.fc6
mysql-connector-java-5.0.5-bin.jar
Reporter: Igor A Tarasov
Problem starts in 3.2.4 version, but in 3.2.3 was all right.
Row ID column is specified as parameter in query, but no value is specified.
Row ID column is autoincrement in MySQL tabled.
10.05.07 14:26:29 DEBUG [btpool0-0]: SQL - insert into PaymentDO (_version, comment, created, customer_id, nalichka, newBalance, payDate, sum, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
10.05.07 14:26:29 TRACE [btpool0-0]: AbstractBatcher - preparing statement
10.05.07 14:26:29 TRACE [btpool0-0]: AbstractEntityPersister - Dehydrating entity: [org.dicr.isp.data.PaymentDO#<null>]
10.05.07 14:26:29 TRACE [btpool0-0]: LongType - binding '0' to parameter: 1
10.05.07 14:26:29 TRACE [btpool0-0]: StringType - binding null to parameter: 2
10.05.07 14:26:29 TRACE [btpool0-0]: TimestampType - binding '2007-05-10 14:26:29' to parameter: 3
10.05.07 14:26:29 TRACE [btpool0-0]: VersionValue - version unsaved-value strategy UNDEFINED
10.05.07 14:26:29 TRACE [btpool0-0]: IdentifierValue - id unsaved-value: 0
10.05.07 14:26:29 TRACE [btpool0-0]: LongType - binding '18128' to parameter: 4
10.05.07 14:26:29 TRACE [btpool0-0]: BooleanType - binding 'false' to parameter: 5
10.05.07 14:26:29 TRACE [btpool0-0]: FloatType - binding '3.0' to parameter: 6
10.05.07 14:26:29 TRACE [btpool0-0]: TimestampType - binding '2007-05-10 00:00:00' to parameter: 7
10.05.07 14:26:29 TRACE [btpool0-0]: FloatType - binding '3.0' to parameter: 8
10.05.07 14:26:29 DEBUG [btpool0-0]: AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10.05.07 14:26:29 TRACE [btpool0-0]: AbstractBatcher - closing statement
10.05.07 14:26:29 DEBUG [btpool0-0]: JDBCExceptionReporter - could not insert: [org.dicr.isp.data.PaymentDO] [insert into PaymentDO (_version, comment, created, customer_id, nalichka, newBalance, payDate, sum, id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)]
java.sql.SQLException: No value specified for parameter 9
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1674)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1512)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1455)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1440)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:73)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:33)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
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.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:213)
at org.dicr.isp.data.HibernateDataManager.createPayment(HibernateDataManager.java:692)
--
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, 11 months