[Hibernate-JIRA] Created: (HV-525) tests fail on openjdk
by Strong Liu (JIRA)
tests fail on openjdk
---------------------
Key: HV-525
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-525
Project: Hibernate Validator
Issue Type: Bug
Environment: [stliu@stliu-rhel hibernate-validator]$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.8) (rhel-1.39.1.9.8.el6_1-x86_64)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
[stliu@stliu-rhel hibernate-validator]$ uname -a
Linux stliu-rhel 2.6.32-131.17.1.el6.x86_64 #1 SMP Thu Sep 29 10:24:25 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
Reporter: Strong Liu
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 429, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 4.698 sec <<< FAILURE!
Results :
Failed tests: scriptExpressionReferencingAnnotatedObject(org.hibernate.validator.test.constraints.impl.ScriptAssertValidatorTest): Error during execution of script "_this.startDate.before(_this.endDate)" occurred.
scriptExpressionUsingCustomizedAlias(org.hibernate.validator.test.constraints.impl.ScriptAssertValidatorTest): Error during execution of script "_.startDate.before(_.endDate)" occurred.
Tests run: 429, Failures: 2, Errors: 0, Skipped: 0
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[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
14 years, 4 months
[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
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-2075) many-to-one in a properties element causes strange PropertyValueException on flush
by Josh Moore (JIRA)
many-to-one in a properties element causes strange PropertyValueException on flush
----------------------------------------------------------------------------------
Key: HHH-2075
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2075
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.cr4
Environment: HSQLDB
Hibernate r10478
Reporter: Josh Moore
Attachments: exception.txt, log.txt, properties.zip
Full test directory zip (org/hibernate/test/properties) attached. But to summarize, the following test will fail on flush after a simple merge. The exception thrown says that Pixels.sizeC is null -- though it's clearly set in the test case.
<code>
Image i = new Image();
Pixels p = new Pixels();
p.setSizeC(new Integer(2));
p.setImage(i); // This calls i.getPixels().add(p)
// i.setPixels(null); // This makes it work.
Session s = openSession();
Transaction t = s.beginTransaction();
// s.merge(i); // This makes it work.
p = (Pixels) s.merge(p); // This fails with the exception below.
t.commit();
s.close();
</code>
The properties element in question is:
<code>
<properties name="defaultPixelsTag">
<property name="defaultPixels" type="java.lang.Boolean"/>
<many-to-one name="image" class="Image" column="image"
not-null="true" unique="false" insert="true" update="true"
cascade="lock,merge,persist,replicate,refresh,save-update"
/>
</properties>
</code>
The reverse side is:
<code>
<set
name="pixels"
lazy="true"
inverse="true"
cascade="lock,merge,persist,replicate,refresh,save-update">
<key column="image" not-null="false"/>
<one-to-many class="Pixels"/>
</set>
</code>
--
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
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-3102) Cascading ManyToOne collections do not eagerly set identifiers on saveOrUpdate()
by Paul Cowan (JIRA)
Cascading ManyToOne collections do not eagerly set identifiers on saveOrUpdate()
--------------------------------------------------------------------------------
Key: HHH-3102
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3102
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Reporter: Paul Cowan
Priority: Minor
Attachments: HibernateKeyPoolTest.java
Hi all,
Not 100% sure if you'd call this a 'bug' as I'm not sure if the correct behaviour is actually specified anywhere. It's certainly oddly inconsistent though.
Please find attached a standalone test case (requires HSQLDB on the classpath; amend setUp() if you need to use something else) which models a parent-child mapping between 'Mouth' (1) and 'Teeth' (many). The Mouth -> Teeth relationship is bidirectional, with CascadeType.ALL on the single-valued end. Both Mouth and Tooth use a @GenericGenerator, which simply allocates integers from a static keypool.
A mouth with one tooth is created, saveOrUpdate()d, session is flushed, a new tooth is added, mouth is saveOrUpdate()d again, and session is again flushed. The debug output is as follows:
*** After creation
Mouth (id=null) has teeth [canine(id=null)]
*** Save
Mouth (id=1) has teeth [canine(id=2)]
*** Flush
Hibernate: insert into Mouth (id) values (?)
Hibernate: insert into Tooth (mouthId, name, id) values (?, ?, ?)
Mouth (id=1) has teeth [canine(id=2)]
*** Add new
Mouth (id=1) has teeth [canine(id=2), molar(id=null)]
*** Save again
Mouth (id=1) has teeth [canine(id=2), molar(id=null)]
*** Flush again
Hibernate: insert into Tooth (mouthId, name, id) values (?, ?, ?)
Mouth (id=1) has teeth [canine(id=2), molar(id=3)]
As you can see, when initially created the IDs for the mouth and tooth are both null (obviously correct). The saveOrUpdate() on the Mouth object then generates identifier values, even though no DB write has been done yet (the .flush()). So far, so good.
However, when a NEW transient Tooth instance ("molar") is added to the Mouth, and saveOrUpdate() is called once more, the id generator is not invoked, UNTIL such time as the session is flushed.
While I guess it's fine for an object in the 'persistent' state not to actually have an identifier until flush-time (e.g. when using DB-side IDENTITY-type generation), it just seems inconsistent that with a @GenericGenerator the behaviour would vary depending on whether the PARENT object was already persistent or not.
There are some obvious workarounds (e.g. flush the session upon saving, or save the child entity first independently) but I thought I'd clarify if this behaviour is by design or not and suggest that this be made consistent.
--
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
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-6377) org.hibernate.cache.infinispan.util.CacheHelper$EvictAll deserialziation issues when running on infinispan clusetr for 2bd Level Cache
by Raúl Raja Martínez (JIRA)
org.hibernate.cache.infinispan.util.CacheHelper$EvictAll deserialziation issues when running on infinispan clusetr for 2bd Level Cache
--------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-6377
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6377
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.6.1
Environment: 3.6.1 Final
Reporter: Raúl Raja Martínez
When running a infinispan cluster for Hibernate 2nd level cache the following exception is shown if a state transfer is attempted between nodes. Also note that lastes released version of JBOSS Marshalling does not show the real exception see https://issues.jboss.org/browse/JBMAR-121.
The following stack trace is shown when building latest JBOSS Marshalling from sources.
The problems seems to be that the private static inner class EvictAll does not provide a default constructor for serialization.
Thread-2 06/28 21:48:26 WARN org.infinispan.remoting.rpc.RpcManagerImpl - ISPN00075: Could not find available peer for state, backing off and retrying
Incoming-2,infinispan-hibernate-cache-cluster,ip-10-38-26-245-34074 06/28 21:48:34 ERROR org.infinispan.remoting.transport.jgroups.JGroupsTransport - ISPN00096: Caught while requesting or applying state
org.infinispan.statetransfer.StateTransferException: java.io.InvalidClassException: org.hibernate.cache.infinispan.util.CacheHelper$EvictAll; Class is non-public or has no public no-arg constructor
at org.infinispan.statetransfer.StateTransferManagerImpl.applyInMemoryState(StateTransferManagerImpl.java:311)
at org.infinispan.statetransfer.StateTransferManagerImpl.applyState(StateTransferManagerImpl.java:280)
at org.infinispan.remoting.InboundInvocationHandlerImpl.applyState(InboundInvocationHandlerImpl.java:230)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.setState(JGroupsTransport.java:604)
at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.handleUpEvent(MessageDispatcher.java:711)
at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:771)
at org.jgroups.JChannel.up(JChannel.java:1441)
at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1074)
at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.connectToStateProvider(STREAMING_STATE_TRANSFER.java:523)
at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.handleStateRsp(STREAMING_STATE_TRANSFER.java:462)
at org.jgroups.protocols.pbcast.STREAMING_STATE_TRANSFER.up(STREAMING_STATE_TRANSFER.java:223)
at org.jgroups.protocols.FRAG2.up(FRAG2.java:189)
at org.jgroups.protocols.FlowControl.up(FlowControl.java:418)
at org.jgroups.protocols.FlowControl.up(FlowControl.java:400)
at org.jgroups.protocols.pbcast.GMS.up(GMS.java:891)
at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:246)
at org.jgroups.protocols.UNICAST.handleDataReceived(UNICAST.java:613)
at org.jgroups.protocols.UNICAST.up(UNICAST.java:294)
at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:703)
at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:133)
at org.jgroups.protocols.FD.up(FD.java:275)
at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:275)
at org.jgroups.protocols.MERGE2.up(MERGE2.java:209)
at org.jgroups.protocols.Discovery.up(Discovery.java:291)
at org.jgroups.protocols.TP.passMessageUp(TP.java:1102)
at org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1658)
at org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1640)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.io.InvalidClassException: org.hibernate.cache.infinispan.util.CacheHelper$EvictAll; Class is non-public or has no public no-arg constructor
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1250)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.readObject(ImmortalCacheEntry.java:132)
at org.infinispan.container.entries.ImmortalCacheEntry$Externalizer.readObject(ImmortalCacheEntry.java:123)
at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:357)
at org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:245)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:351)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
at org.infinispan.marshall.exts.SetExternalizer.readObject(SetExternalizer.java:78)
at org.infinispan.marshall.exts.SetExternalizer.readObject(SetExternalizer.java:47)
at org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:357)
at org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:245)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:351)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)
at org.infinispan.marshall.jboss.GenericJBossMarshaller.objectFromObjectStream(GenericJBossMarshaller.java:191)
at org.infinispan.marshall.VersionAwareMarshaller.objectFromObjectStream(VersionAwareMarshaller.java:191)
at org.infinispan.statetransfer.StateTransferManagerImpl.applyInMemoryState(StateTransferManagerImpl.java:306)
... 29 more
Caused by: an exception which occurred:
in object of type org.hibernate.cache.infinispan.util.CacheHelper$EvictAll
Thread-2 06/28 21:48:34 WARN org.infinispan.remoting.rpc.RpcManagerImpl - ISPN00075: Could not find available peer for state, backing off and retrying
--
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
14 years, 4 months