Henry Clout (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5bd6e4b...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNjc3OGMzMjZk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-13915?atlOrigin=eyJpIjoiNjc3OG...
) HHH-13915 (
https://hibernate.atlassian.net/browse/HHH-13915?atlOrigin=eyJpIjoiNjc3OG...
) Shared state in ByteBuddy basic proxies leads to intermittently broken persistence (
https://hibernate.atlassian.net/browse/HHH-13915?atlOrigin=eyJpIjoiNjc3OG...
)
Change By: Henry Clout (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5bd6e4b...
)
When persisting a parent, child relationship - cascaded from parent to child - with the
child having a composite unique key configured as:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.qumu">
<class name="MetadataValue" table="metadata_value">
<id column="id" name="id" type="long">
<generator class="native">
<param name="sequence">hibernate_sequence</param>
</generator>
</id>
<properties name="unique-props" unique="true">
<property column="guid" name="guid" not-null="true"
type="string"/>
<many-to-one class="com.qumu.Customer" column="customer_id"
name="customer" not-null="true"/>
</properties>
</class>
</hibernate-mapping>
{code}
A ByteBuddy BasicProxyFactoryImpl is used by Hibernate to proxy the composite unique key
values. However generate proxies , this factory generates the proxies which it generates
share a common ProxyConfiguration.Interceptor. As - which is used to hold the interceptor
holds the bean state. This then breaks during persistence, this leads to persistence
failure under concurrent use.
In our particular use case, this manifested as unique constraint failures as the guid
property above was reused by parallel threads sharing compete for the interceptor state.
Proposed solution is to instantiate a new interceptor per innovation of {{
BasicProxyFactoryImpl. getProxy() }}
A PR has been raised as per this proposal.
(
https://hibernate.atlassian.net/browse/HHH-13915#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-13915#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100123- sha1:a8fd8fd )