[Hibernate-JIRA] Created: (HHH-6160) NPE when setting readOnly hint
by David J. M. Karlsen (JIRA)
NPE when setting readOnly hint
------------------------------
Key: HHH-6160
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6160
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.6.3
Environment: 3.6.3, jpa2, 64 bit IBM JDK, atomikos jta tx mgr
Reporter: David J. M. Karlsen
I get the following stack trace when executing a Named Query which was defined like this:
<lock-mode>READ</lock-mode>
<hint name="org.hibernate.readOnly" value="true" />
if I remove the hint it works fine.
{noformat}
javax.persistence.PersistenceException: error during managed flush
at org.hibernate.ejb.AbstractEntityManagerImpl$3.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1072)
at org.hibernate.transaction.synchronization.CallbackCoordinator.beforeCompletion(CallbackCoordinator.java:122)
at org.hibernate.transaction.synchronization.HibernateSynchronizationImpl.beforeCompletion(HibernateSynchronizationImpl.java:51)
at com.atomikos.icatch.jta.Sync2Sync.beforeCompletion(Sync2Sync.java:55)
at com.atomikos.icatch.imp.TransactionStateHandler.commit(TransactionStateHandler.java:278)
at com.atomikos.icatch.imp.CompositeTransactionImp.doCommit(CompositeTransactionImp.java:319)
at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:79)
at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:236)
at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:498)
at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:129)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1009)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at net.bull.javamelody.MonitoringSpringInterceptor.invoke(MonitoringSpringInterceptor.java:73)
at com.edb.finance.common.spring.aop.monitoring.ExtendedMonitoringSpringInterceptor.invoke(ExtendedMonitoringSpringInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:67)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy157.create(Unknown Source)
at com.edb.payment.pays.ws.service.payment.initiate.PaymentInitiateCreateService.handleInternal(PaymentInitiateCreateService.java:45)
at com.edb.payment.pays.ws.service.payment.initiate.PaymentInitiateCreateService.handleInternal(PaymentInitiateCreateService.java:12)
at com.edb.payment.pays.ws.service.AbstractService.handle(AbstractService.java:96)
at com.edb.payment.pays.ws.service.payment.initiate.PaymentInitiateCreateService.pAYSPaymentInitiateCreate_V1_0(PaymentInitiateCreateService.java:27)
at sun.reflect.GeneratedMethodAccessor246.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
{noformat}
--
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, 11 months
[Hibernate-JIRA] Created: (HV-466) Avoid repeated validation of constraints in certain type hierarchies
by Gunnar Morling (JIRA)
Avoid repeated validation of constraints in certain type hierarchies
--------------------------------------------------------------------
Key: HV-466
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-466
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Reporter: Gunnar Morling
Priority: Minor
Fix For: 4.x
Let there be the following type hierarchy where the same interface is implemented by two types in an inheritance hierarchy:
{code:java}
public interface A {
@NotNull
String getA();
}
public class B implements A {
public String getA() {
return null;
}
}
public class C extends B implements A {
}
{code}
When validating an instance of {{C}} the {{@NotNull}} constraint on {{A#getA()}} is evaluated twice when traversing the type hierarchy of {{C}} in {{ValidatorImpl}}.
This seems to be against the BV spec. which says in chapter 3.5:
{quote}
Note that this [algorithm] implies that a given validation constraint will not be processed more than once per validation.
{quote}
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-6157) Column under a duplicate alias in union-subclass filtered from select statement
by Diego del Río (JIRA)
Column under a duplicate alias in union-subclass filtered from select statement
-------------------------------------------------------------------------------
Key: HHH-6157
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6157
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.1
Environment: Hibernate Core 3.6.1.Final
Database ->
name : HSQL Database Engine
version : 1.8.0
major : 1
minor : 8
Driver ->
name : HSQL Database Engine Driver
version : 1.8.0
major : 1
minor : 8
Reporter: Diego del Río
Attachments: test_case.zip
I think there is a bug in the process of column alias generation.
Given this mapping
{code:xml}
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.headlesspigs.domainmodel">
<class name="Invoice" abstract="true">
<id name="id" column="ID" type="long" unsaved-value="0">
<generator class="hilo" />
</id>
<property name="name" type="string" column="DS_NAME" />
<union-subclass name="SpecificInvoice" table="TEST_SPECIFIC">
<!-- "sameNameAsInvoice" is intentionally mapped to the same column as
the inherited property "name" is -->
<property name="sameNameAsInvoice" type="string" column="DS_NAME"
insert="false" update="false" />
<property name="number" column="DS_NUMBER" type="string" />
<property name="code" column="DS_CODE" type="string" />
</union-subclass>
</class>
</hibernate-mapping>
{code}
During the process of alias generation, the column {{DS_CODE}} gets the same alias as the column {{DS_NAME}} from {{SpecificInvoice}}. Later on, when the {{UnionSubclassEntityPersister}} builds the _select_ part of the SQL statement in the method {{propertySelectFragment()}}, {{DS_CODE}} is filtered out from the select string in the method {{SelectFragment.toFragmentString()}}.
When the entity is being loaded, the entity loader uses the wrong alias for the {{DS_CODE}} column and instead obtains the value of the column {{DS_NAME}}, leading to an {{SpecificInvoice}} instance with the wrong value for the property _code_. If, instead, the property _code_ had a different type, e.g. {{many-to-one}}, that would potentially lead to an {{ObjectNotFoundException}}, because the identifier used to load the associated entity would be wrong.
A test case (along with the mapping file and domain classes) is attached, that shows the entity {{SpecificInvoice}} being loaded with its property _code_ with the wrong value.
--
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, 11 months
[Hibernate-JIRA] Updated: (HHH-1907) offload metadata information from ComponentType to SessionFactory
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1907?page=c... ]
Steve Ebersole updated HHH-1907:
--------------------------------
Fix Version/s: (was: 4.0.0.Alpha3)
4.1.0
> offload metadata information from ComponentType to SessionFactory
> -----------------------------------------------------------------
>
> Key: HHH-1907
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1907
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Reporter: Steve Ebersole
> Assignee: Steve Ebersole
> Fix For: 4.1.0
>
>
> Specifically, we need to move all the code directly dealing with property-access, instantiation, etc out of here. So where do we move it? Well, EntityType for example moves this stuff off to the persisters; the type then just looks up the persister when needed. Not sure we actually need a persister per-se for handling components; perhaps just ComponentMetamodel is enough...
> Why is this important? Well the way ComponentType is currently structured leads to the need for certain configuration properties to be classloader scoped (static on Environment) instead of SessionFactory scoped. This is painful for two in particular: 1) whether to use reflection optimization and 2) bytecode provider.
> Also, this change should allow us to cleanup how property accessors are built
> Long term it would facilitate the ability to have hierarchies of components as well as loading components in a 2-phase-load paradigm like entities and collections.
--
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, 11 months