[Hibernate-JIRA] Created: (HHH-6236) NullPointerException in org.hibernate.type.EntityType.isEqual
by Thomas Stinner (JIRA)
NullPointerException in org.hibernate.type.EntityType.isEqual
-------------------------------------------------------------
Key: HHH-6236
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6236
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.4
Environment: Hibernate 3.6.4, MySQL 5.5.8, Linux x64
Reporter: Thomas Stinner
The following error does not occur every time, but in 75% of all program starts.
The error either occurs on one of the first queries to the database, or does not occur at all.
We solve this issue by simply restarting the application and trying again. It also happens with other applications, not only this one.
INFO | jvm 1 | 2011/05/19 10:43:19 | Caused by: java.lang.NullPointerException
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.type.EntityType.isEqual(EntityType.java:344)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.type.ComponentType.isEqual(ComponentType.java:176)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.engine.CollectionKey.equals(CollectionKey.java:71)
INFO | jvm 1 | 2011/05/19 10:43:19 | at java.util.HashMap.put(HashMap.java:376)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.engine.StatefulPersistenceContext.addCollection(StatefulPersistenceContext.java:820)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.engine.StatefulPersistenceContext.addUninitializedCollection(StatefulPersistenceContext.java:789)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.type.CollectionType.getCollection(CollectionType.java:643)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:431)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.type.CollectionType.resolve(CollectionType.java:425)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:139)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:982)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.doQuery(Loader.java:857)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3293)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1038)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:630)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.type.EntityType.resolve(EntityType.java:438)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:139)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:982)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.doQuery(Loader.java:857)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.doList(Loader.java:2533)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.Loader.list(Loader.java:2271)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
INFO | jvm 1 | 2011/05/19 10:43:19 | at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)
INFO | jvm 1 | 2011/05/19 10:43:19 | at de.schuechen.tms.abrechnung.RechnungenErzeugen.ausRgVorschlag(RechnungenErzeugen.java:106)
INFO | jvm 1 | 2011/05/19 10:43:19 | at de.schuechen.tms.abrechnung.RechnungenReporter.createJasperPrint(RechnungenReporter.java:136)
INFO | jvm 1 | 2011/05/19 10:43:19 | ... 5 more
STATUS | wrapper | 2011/05/19 10:43:22 | TERM trapped. Shutting down.
--
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
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-5872) Methos generate in org.hibernate.id.enhanced.OptimizerFactory$PooledLoOptimizer classs is not synchronized
by Tchavdar Roussanov (JIRA)
Methos generate in org.hibernate.id.enhanced.OptimizerFactory$PooledLoOptimizer classs is not synchronized
-----------------------------------------------------------------------------------------------------------
Key: HHH-5872
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5872
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0, 3.6.0.CR2, 3.6.0.CR1, 3.5.6, 3.6.0.Beta4, 3.6.0.Beta3, 3.5.5, 3.6.0.Beta2, 3.6.0.Beta1, 3.5.4, 3.5.3, 3.5.2
Environment: Hibernate 3.5.6-Final, Oracle 11g, WebSphere 6.1 cluster
Reporter: Tchavdar Roussanov
Receiving multiple primary key constraint violation exceptions when using SequenceStyleGenerator with optimizer parameter set to pooled-lo. Looking into the source code I found that the generate mathod for the new PooledLoOptimizer is not synchronized. After switching to PooledOptimizer (which has synchronized generate method) every thing 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
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-5303) @Cachable has no effect
by Paul Bakker (JIRA)
@Cachable has no effect
-----------------------
Key: HHH-5303
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5303
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2), entity-manager
Affects Versions: 3.5.2
Environment: Tested on HSQL (included in testcase) and MySQL database
Reporter: Paul Bakker
The JPA 2.0 @Cachable annotation has no effect at all. Just putting @Cachable on a class is not enough to enable caching. You must also configure a concurrency strategy with either @Cache or a hibernate.ejb.classcache setting in persistence.xml.
If those settings are in place, @Cacheble still has no effect. Entities are cached, but @Cachable(false) doesn't change this behavior.
I included a Maven example project that tests this behavior. The project has two profiles to switch between Hibernate and EclipseLink:
mvn -P hibernate clean test
mvn -P eclipselink clean test
--
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
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-3637) Union in where doesn't works for Sybase, need to evict test case
by Juraci Paixao Krohling (JIRA)
Union in where doesn't works for Sybase, need to evict test case
----------------------------------------------------------------
Key: HHH-3637
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3637
Project: Hibernate Core
Issue Type: Improvement
Components: testsuite
Environment: Sybase ASE 15.0.2
Reporter: Juraci Paixao Krohling
Assignee: Juraci Paixao Krohling
It seems that Sybase doesn't supports UNION inside WHERE clauses, causing the test DynamicFilterTest#testSqlSyntaxOfFiltersWithUnions to fail. The scenario for this test case is not described in the documentation, but I would expect it to work:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter....
The query is:
select
category0_.CAT_ID as CAT1_6_,
category0_.name as name6_,
category0_.eff_start_dt as eff3_6_,
category0_.eff_end_dt as eff4_6_
from
CATEGORY category0_
where
'abc' in (
select
d.reg
from
department d
where
(
d.dept_id=123
)
union
select
p.name
from
sales_person p
)
If executed only the queries from inside the where clause (the two selects with union), it works as expected. Also, if removed the union and one of the queries inside the where, it works as expected. So, the problem happens only when using union inside a where clause.
For now, I'd suggest to evict this test for Sybase.
--
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
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-2447) Connection leak if logAndClearWarnings throws
by Jeppe N. Madsen (JIRA)
Connection leak if logAndClearWarnings throws
----------------------------------------------
Key: HHH-2447
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2447
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.3, 3.2.2
Environment: Database product name : DB2/NT
Database product version : SQL08025
JDBC driver name : IBM DB2 JDBC Universal Driver Architecture
Hibernate 3.1.3 (seems to exist in 3.2.2 as well)
JDBC driver version : 2.9.31
Reporter: Jeppe N. Madsen
Priority: Minor
In ConnectionManager.closeConnection, logAndClearWarnings is called before connection.close() is called. If this call throws an exception, the connection is never closed.
We have observed that DB2 sometimes throws an Error because the SQLWarning chain is wrong:
[14-02-07 11:36:30:889 CET] 10b0b533 WebGroup E SRVE0026E: [Servlet Error]-[SQLWarning chain holds value that is not a SQLWarning]: java.lang.Error: SQLWarning chain holds value that is not a SQLWarning
at java.sql.SQLWarning.getNextWarning(SQLWarning.java:109)
at org.hibernate.util.JDBCExceptionReporter.logWarnings(JDBCExceptionReporter.java:50)
at org.hibernate.util.JDBCExceptionReporter.logWarnings(JDBCExceptionReporter.java:33)
at org.hibernate.util.JDBCExceptionReporter.logAndClearWarnings(JDBCExceptionReporter.java:22)
at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:443)
at org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:379)
at org.hibernate.jdbc.ConnectionManager.close(ConnectionManager.java:318)
at org.hibernate.impl.SessionImpl.close(SessionImpl.java:293)
--
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
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-6143) ElementCollection in Embeddable in Entity is ignored on merge
by Andy Schlaikjer (JIRA)
ElementCollection in Embeddable in Entity is ignored on merge
-------------------------------------------------------------
Key: HHH-6143
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6143
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.3
Environment: Hibernate EntityManager 3.6.3, HSQLDB 2.0.0
Reporter: Andy Schlaikjer
Attachments: merge-embedded-elementcollection.zip
*Overview*
When an {{@ElementCollection}} field {{ec}} is defined within an {{@Embeddable}} type {{C}}, and an {{@Embedded}} field {{em}} of type {{C}} is defined within an {{@Entity}} type {{E}}, if we create an {{E}} instance {{e}} and initialize {{e.em.ec}}, the value of {{e.em.ec}} is ignored on merge of {{e}}. Furthermore, the value is ignored even when {{ec}} has been annotated with {{@ElementCollection(fetch = FetchType.EAGER)}} and Hibernate's {{@Cascade(ALL)}}, and {{em}} has been annotated with {{@Cascade(ALL)}}.
Disclaimer: This use case may not be required by the JPA 2.0 spec (though it'd be nice to see support):
{quote}
Implementations are not required to support embedded objects that are mapped across more than one table (e.g., split across primary and secondary tables or multiple secondary tables).
{quote}
Note: This issue may be related to HHH-5187, HHH-4135.
*Steps to reproduce*
# Define {{@Embeddable}} type {{ContactInfo}} with {{@ElementCollection}} field {{emailAddresses}} of type {{List<String>}}.
# Define {{@Entity}} type {{Person}} with {{@Embedded}} field {{contactInfo}} of type {{ContactInfo}}.
# Create a new {{Person}} instance {{p1}} and initialize {{p1.contactInfo.emailAddresses}}.
# Use {{EntityManager}} to merge {{p1}}.
# Use {{EntityManager}} to find {{Person}} with id matching that of {{p1}}; Init {{p2}} with result.
# Compare {{p1}} and {{p2}}.
.
*Expected*
{{Person}} instances {{p1}} and {{p2}} are identical. Specifically, {{p2.contactInfo.emailAddresses}} should not be null, and its contents should match that of {{p1.contactInfo.emailAddresses}}.
*Observed*
{{Person}} instances {{p1}} and {{p2}} are not equal: {{p2.contactInfo.emailAddresses}} is null. On merge of {{p1}} Hibernate is ignoring non-null {{p1.contactInfo.emailAddresses}} property value. From the source code, it looks like the {{p1.contactInfo.emailAddresses}} property value is not being copied into the EntityManager's managed instance of {{p1}} on merge.
*Test case*
Please see the attached Maven project for full unit test.
--
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
13 years, 1 month
[Hibernate-JIRA] Created: (HHH-4015) one-to-one: foreign key: save Problem
by Sandeep Vaid (JIRA)
one-to-one: foreign key: save Problem
-------------------------------------
Key: HHH-4015
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4015
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Reporter: Sandeep Vaid
Priority: Critical
I have one-to-one relationship between class A and class B
<class name="A" table="TEMPA" >
<id name="aaId" type="string" column="AID" length="10">
<generator class="assigned"></generator>
</id>
<one-to-one name="b" class="B" constrained="true" outer-join="false" cascade="save-update" />
</class>
<class name="B" table="TEMPB" lazy="true">
<id name="baId" type="string" column="BID" length="10">
<generator class="foreign">
<param name="property">a</param>
</generator>
</id>
<one-to-one name="a" class="A" />
</class>
Problem 1: When i try to save A, it fires :
insert into HBLEARN1.TEMPB (BID) values ('1')
and throws error :
The insert or update value of the FOREIGN KEY "TEMPB.CC1246876555824" is not equal to any value of the
parent key of the parent table. SQLSTATE=23503
Why it is first trying to save 'B' instead of 'A' first ?
Problem 2: With this mapping, if i set <property name="hibernate.hbm2ddl.auto">create</property> in hibernate.cfg.xml,
It generates TEMPA whose aaId is the foreign key referencing TEMPB. This is also incorrect..
--
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
13 years, 1 month