[Hibernate-JIRA] Closed: (HHH-907) optimistic-lock="false" for timestamped object results in SQLException: Invalid column index
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-907?page=co... ]
Steve Ebersole closed HHH-907.
------------------------------
Closing stale resolved issues
> optimistic-lock="false" for timestamped object results in SQLException: Invalid column index
> --------------------------------------------------------------------------------------------
>
> Key: HHH-907
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-907
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5
> Environment: Windows/Oracle 10g JDBC driver / Oracle 9.2 RDBMS
> Solaris/Oracle 9.2 JDBC/RDBMS (different exception thrown for the same problem)
> Reporter: Dmitri Rasnitsyn
> Assignee: Gavin King
> Fix For: 3.1 rc 1
>
>
> Setting optimistic-lock="false" for an attribute in the object with timestamp version results in SQLException: invalid column index when session is flashed. This happens if the attribute with optimistic-lock="false" is the only attribute changed (so the timestamp should not be incremented).
> Hibernate generates correct SQL:
> update MO set deletionInd=? where MOOID=?
> But then calls OraclePreparedStatement.setTimestamp () (none of the ? corresponds to the timestamp)
> http://forum.hibernate.org/viewtopic.php?t=946776
> Mapping documents:
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
> >
> <hibernate-mapping package="com.lucent.ic.framework.data" >
> <class name="Mo" table="MO" dynamic-update="true" >
> <id
> column="MOOID"
> name="moOid"
> type="java.lang.Long"
> length="12"
> >
> <generator class="sequence"><param name="sequence">MoOid</param></generator>
> </id>
> <discriminator column="moType" type="string" length="23" insert="false" />
> <natural-id>
> <property
> column="moName"
> length="200"
> name="moName"
> not-null="true"
> type="string"
> />
> </natural-id>
> <timestamp
> name="lastUpdate"
> column="lastUpdate"
> />
> <property
> column="deletionInd"
> optimistic-lock="false"
> length="1"
> name="deletionInd"
> not-null="false"
> type="boolean"
> />
> <property
> column="lockedInd"
> length="1"
> name="lockedInd"
> not-null="false"
> type="boolean"
> />
> <!-- The rest is omitted -->
> </class>
> </hibernate-mapping>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping package="com.lucent.ic.framework.data.mot">
> <subclass name="MotAP_DS1" extends="com.lucent.ic.framework.data.Mo"
> discriminator-value="AP_DS1" dynamic-update="true" batch-size="500">
> <join table="MOT_AP_DS1" fetch="select">
> <key column="moOid"/>
> <!-- the rest is omitted -->
> </join>
> </subclass>
> </hibernate-mapping>
> Full stack trace of any exception that occurs:
> 3601447 2005-08-24 23:05:53,142: [pool-1-thread-2] DEBUG org.hibernate.util.JDBCExceptionReporter:63 - could not update: [com.lucent.ic.framework.data.mot.MotAP_DS1#24951]; Object: { [ Mo: com.lucent.ic.framework.data.mot.MotAP_DS1@dba04f33: MoOid: 24951; MoType: AP_DS1; MoName: /System:SysId=10/ECP:ECPId=1/AP:APId=11/AP_DS1:DS1Id=1]; ; Mot attributes: {DS1Id=1, protocol=LAPD, link_spd=null, APId=11, boardtype=INTER, custom1=null, custom4=null, status=e, custom3=null, custom5=null, custom2=null, framing_mode=esf, ECPId=1, rsvd1_tdma=null, SysId=10, line_coding=b8zs, line_rate=t1} } [/* update com.lucent.ic.framework.data.mot.MotAP_DS1 */ update MO set deletionInd=? where MOOID=?]
> java.sql.SQLException: Invalid column index
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setTimestampInternal(OraclePreparedStatement.java:6272)
> at oracle.jdbc.driver.OraclePreparedStatement.setTimestamp(OraclePreparedStatement.java:6247)
> at org.hibernate.type.TimestampType.set(TimestampType.java:43)
> at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
> at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44)
> at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1993)
> at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1935)
> at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2189)
> at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75)
> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
> at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
> at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
> at com.lucent.ic.framework.data.base._BaseRootDAO.flushAndClearSession(_BaseRootDAO.java:719)
> at com.lucent.ic.framework.data.dao.MotDAOImpl.flushAndClearSession(MotDAOImpl.java:316)
> at com.lucent.ic.framework.data.base._BaseRootDAO.flushAndClerSession(_BaseRootDAO.java:708)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
> at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:163)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
> at $Proxy9.flushAndClerSession(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
> at $Proxy10.flushAndClerSession(Unknown Source)
> at com.lucent.ic.framework.adapters.manager.GenericDataAdapter.processFile(GenericDataAdapter.java:67)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
> at $Proxy24.processFile(Unknown Source)
> at com.lucent.ic.framework.adapters.manager.GenericAdapter$DaExecutor.call(GenericAdapter.java:291)
> at com.lucent.ic.framework.adapters.manager.GenericAdapter$DaExecutor.call(GenericAdapter.java:1)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
> at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> at java.lang.Thread.run(Thread.java:595)
> 3601494 2005-08-24 23:05:53,189: [pool-1-thread-2] WARN org.hibernate.util.JDBCExceptionReporter:71 - SQL Error: 17003, SQLState: null
> 3601494 2005-08-24 23:05:53,189: [pool-1-thread-2] ERROR org.hibernate.util.JDBCExceptionReporter:72 - Invalid column index
> 3601603 2005-08-24 23:05:53,298: [pool-1-thread-2] ERROR org.hibernate.persister.entity.BasicEntityPersister:2036 - Failed to update:
> org.hibernate.exception.GenericJDBCException: could not update: [com.lucent.ic.framework.data.mot.MotAP_DS1#24951]; Object: { [ Mo: com.lucent.ic.framework.data.mot.MotAP_DS1@dba04f33: MoOid: 24951; MoType: AP_DS1; MoName: /System:SysId=10/ECP:ECPId=1/AP:APId=11/AP_DS1:DS1Id=1]; ; Mot attributes: {DS1Id=1, protocol=LAPD, link_spd=null, APId=11, boardtype=INTER, custom1=null, custom4=null, status=e, custom3=null, custom5=null, custom2=null, framing_mode=esf, ECPId=1, rsvd1_tdma=null, SysId=10, line_coding=b8zs, line_rate=t1} }
> at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
> at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2026)
> at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1935)
> at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2189)
> at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75)
> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
> at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
> at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
> at com.lucent.ic.framework.data.base._BaseRootDAO.flushAndClearSession(_BaseRootDAO.java:719)
> at com.lucent.ic.framework.data.dao.MotDAOImpl.flushAndClearSession(MotDAOImpl.java:316)
> at com.lucent.ic.framework.data.base._BaseRootDAO.flushAndClerSession(_BaseRootDAO.java:708)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
> at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:163)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
> at $Proxy9.flushAndClerSession(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
> at $Proxy10.flushAndClerSession(Unknown Source)
> at com.lucent.ic.framework.adapters.manager.GenericDataAdapter.processFile(GenericDataAdapter.java:67)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57)
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
> at $Proxy24.processFile(Unknown Source)
> at com.lucent.ic.framework.adapters.manager.GenericAdapter$DaExecutor.call(GenericAdapter.java:291)
> at com.lucent.ic.framework.adapters.manager.GenericAdapter$DaExecutor.call(GenericAdapter.java:1)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
> at java.util.concurrent.FutureTask.run(FutureTask.java:123)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> at java.lang.Thread.run(Thread.java:595)
> Caused by: java.sql.SQLException: Invalid column index
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at oracle.jdbc.driver.OraclePreparedStatement.setTimestampInternal(OraclePreparedStatement.java:6272)
> at oracle.jdbc.driver.OraclePreparedStatement.setTimestamp(OraclePreparedStatement.java:6247)
> at org.hibernate.type.TimestampType.set(TimestampType.java:43)
> at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:62)
> at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:44)
> at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1993)
> ... 53 more
> Name and version of the database you are using:
> Oracle 9.2
--
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
[Hibernate-JIRA] Closed: (HHH-997) FetchMode.JOIN in Criteria not working as expected
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-997?page=co... ]
Steve Ebersole closed HHH-997.
------------------------------
Closing stale resolved issues
> FetchMode.JOIN in Criteria not working as expected
> --------------------------------------------------
>
> Key: HHH-997
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-997
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.0.5, 3.1 beta 2
> Environment: WinXP, JDK 1.4.2, Oracle
> Reporter: Vladimir Kamba
> Original Estimate: 20m
> Remaining Estimate: 20m
>
> I'm trying to create Criteria select and I need to outer join the aliased Class.
> Criteria crit = getSession().createCriteria(Transaction.class).createAlias("accountFrom","accountFrom").setFetchMode("accountFrom", FetchMode.JOIN);
> I expect the code above to generate left outer join statement but it doesn't.
> I tried to inspect the Hibernate source and found the potential bug location:
> Hibernate 3.0.5 - org.hibernate.loader.criteria.CriteriaLoader - method getJoinType
> Hibernate 3.1.b3 - org.hibernate.loader.criteria.CriteriaJoinWalker - method getJoinType
> the first condition in the protected getJoinType(...) method is
> if ( translator.isJoin(path) ) {
> return JoinFragment.INNER_JOIN;
> }
> else { ...
> WHY???
> Evaluation of my criteria fulfils the condition above and returns the JoinFragment.INNER_JOIN what results in INNER join statement.
> I recomend to change the first condition in the getJoinType method to:
> if ( translator.isJoin(path) ) {
> FetchMode fm = translator.getRootCriteria().getFetchMode(path);
> if ( fm==FetchMode.JOIN ) {
> return getJoinType(nullable, currentDepth);
> }
> else {
> return -1;
> }
> }
> else ...
> Maybe I'm wrong and there is some other way to fix my criteria. If so then please let me know.
> Thanks
> Vladimir
--
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
[Hibernate-JIRA] Closed: (HHH-1095) Hibernate takes incorrect HasCode when a lot of CompositeKeys and Lazy loading is involved
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1095?page=c... ]
Steve Ebersole closed HHH-1095.
-------------------------------
Closing stale resolved issues
> Hibernate takes incorrect HasCode when a lot of CompositeKeys and Lazy loading is involved
> ------------------------------------------------------------------------------------------
>
> Key: HHH-1095
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1095
> Project: Hibernate Core
> Issue Type: Patch
> Affects Versions: 3.1 rc2
> Environment: Hibernate 3.0.5 and 3.1-cvs
> Reporter: Konstantin Ignatyev
> Fix For: 3.1 rc3
>
> Attachments: EntityType.java.3.0.5.patch, EntityType.java.3.1.patch, sup7repro.zip
>
>
> The problem is that when trying to load the OrderLines collection from an Order, the set came back as being empty, which it should not have.
> It is important to note that Order has a composite primary key composed of order_id and District. This is encapsulated in an OrderId class. District has a composite primary key composed of d_id and Warehouse, this is encapsulated in a districtId class. Warehouse has an integer as it's primary key.
> OrderLine has a composite primary key that is composed of Order and ol_number (which is a short). This is encapsulated in an OrderLineId class.
> Each of the custom classes that represents a composite primarey key has hash() and equals() overridden.
> The problem we seem to be running into is that when Hibernate loads the collection for this object it first runs through and creates an emply collection in the CollectionLoadingContext. It does this with the OrderId it gets from the PersistantColleciton, which is already fully loaded and has an actual District rather that a proxied District.
> Then when we process our query results we get back into getLoadingCollection with the OrderId we read from the ResultSet. The problem here is that the District it has is proxied.
> So the fix for that is to change EntityType#getHashCode function like this:
> public int getHashCode(Object x, EntityMode entityMode, SessionFactoryImplementor factory) {
> EntityPersister persister = factory.getEntityPersister(associatedEntityName);
> if ( !persister.hasIdentifierPropertyOrEmbeddedCompositeIdentifier() ) {
> return super.getHashCode(x, entityMode);
> }
> Serializable id;
> if (x instanceof HibernateProxy) {
> id = ( (HibernateProxy) x ).getHibernateLazyInitializer().getIdentifier();
> } else {
> id = persister.getIdentifier(x, entityMode);
> }
> return persister.getIdentifierType().getHashCode(id, entityMode, factory);
> }
> The attached files include:
> - a test case to reproduce the problem: run by Maven1 with command maven jar. The error report gets created under target. The maven assumes that there is j2ee-1.3.1.jar file is in local Maven repository.
> - couple of patches, one for 3.0.5 and another for 3.1
>
--
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
[Hibernate-JIRA] Closed: (HHH-1065) user provided connection not usable by default due to agressive release changes
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1065?page=c... ]
Steve Ebersole closed HHH-1065.
-------------------------------
Closing stale resolved issues
> user provided connection not usable by default due to agressive release changes
> -------------------------------------------------------------------------------
>
> Key: HHH-1065
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1065
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Environment: cvs head of 2005-19-10
> Reporter: Stephan Fudeus
> Assignee: Steve Ebersole
> Fix For: 3.1
>
>
> When I'm using the UserSuppliedConnectionProvider calling userConnection() on JDBCContext leads to
> "java.lang.UnsupportedOperationException: The user must supply a JDBC connection" even when I supplied a connection creating the session.
> It seems that agressive release defaults to true even on user-supplied connections, so JDBCContext.userConnection() tries to return getFactory().getConnectionProvider().getConnection() instead of the locally referenced (user supplied) connection.
> Relevant stacktrace:
> java.lang.UnsupportedOperationException: The user must supply a JDBC connection
> at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:30)
> at org.hibernate.jdbc.JDBCContext.userConnection(JDBCContext.java:114)
> at org.hibernate.impl.SessionImpl.connection(SessionImpl.java:366)
--
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
[Hibernate-JIRA] Closed: (HHH-1676) org.hibernate.cfg.Configuration should obey standard java.util.Properties overwrite rules
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1676?page=c... ]
Steve Ebersole closed HHH-1676.
-------------------------------
Closing stale resolved issues
> org.hibernate.cfg.Configuration should obey standard java.util.Properties overwrite rules
> -----------------------------------------------------------------------------------------
>
> Key: HHH-1676
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1676
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Affects Versions: 3.0 alpha, 3.0 beta 1, 3.0 beta 2, 3.0 beta 3, 3.0 beta 4, 3.0 rc 1, 3.0 final, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.1 beta 1, 3.1 beta 2, 3.1 rc 1, 3.1 rc2, 3.1 rc3, 3.1, 3.1.1, 3.1.2, 3.2.0.alpha1, 3.2.0.alpha2, 3.1.3, 3.2.0 cr1, 3.2.0.cr2, 3.2.1
> Environment: All environments
> Reporter: Ben Wolfe
> Priority: Minor
> Original Estimate: 2m
> Remaining Estimate: 2m
>
> Standard Java properties operate under the principal of "first come first served". Once a property has a value it is not changed by a later attempt.
> The method org.hibernate.cfg.Configuration.addProperties(Element parent) should read
> private void addProperties(Element parent) {
> Iterator iter = parent.elementIterator( "property" );
> while ( iter.hasNext() ) {
> Element node = (Element) iter.next();
> String name = node.attributeValue( "name" );
> String value = node.getText().trim();
> log.debug( name + "=" + value );
> if (properties.containsKey(name)
> continue;
> properties.setProperty( name, value );
> if ( !name.startsWith( "hibernate" ) ) {
> properties.setProperty( "hibernate." + name, value );
> }
> }
> Environment.verifyProperties( properties );
> }
--
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
[Hibernate-JIRA] Closed: (HHH-1266) StatelessSession can implement refresh
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1266?page=c... ]
Steve Ebersole closed HHH-1266.
-------------------------------
Closing stale resolved issues
> StatelessSession can implement refresh
> --------------------------------------
>
> Key: HHH-1266
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1266
> Project: Hibernate Core
> Issue Type: Improvement
> Components: core
> Affects Versions: 3.1
> Reporter: Barthel Steckemetz
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: 3.2.0.cr2
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> The refresh method in StatelessSession is missing.
> I took the following implementation from DefaultRefreshEventListener onRefresh
> and modified it. As the stateless Session does not support collection loading,
> proxies and eviction the relevant lines are commented.
> StatelessSessionImpl:
> public void refresh(Object object) throws HibernateException {
> refresh(object, LockMode.READ);
> }
>
> // code taken from DefaultRefreshEventListener onRefresh
> public void refresh( Object obj, LockMode lockMode ) throws HibernateException {
> final AbstractSessionImpl source = this;
>
> // not applicable in stateless session: if ( source.getPersistenceContext().reassociateIfUninitializedProxy( obj ) ) return;
> final Object object = obj; // BST source.getPersistenceContext().unproxyAndReassociate( obj );
> // not applicable in stateless session:
> // if ( refreshedAlready.containsKey(object) ) {
> // log.trace("already refreshed");
> // return;
> // }
> final EntityEntry e = source.getPersistenceContext().getEntry( object );
> final EntityPersister persister;
> final Serializable id;
> Log log = LogFactory.getLog(this.getClass());
>
> if ( e == null ) {
> persister = source.getEntityPersister(null, object); //refresh() does not pass an entityName
> id = persister.getIdentifier( object, getEntityMode() );
> if ( log.isTraceEnabled() ) {
> log.trace(
> "refreshing transient " +
> MessageHelper.infoString( persister, id, source.getFactory() )
> );
> }
> EntityKey key = new EntityKey( id, persister, source.getEntityMode() );
> if ( source.getPersistenceContext().getEntry(key) != null ) {
> throw new PersistentObjectException(
> "attempted to refresh transient instance when persistent instance was already associated with the Session: " +
> MessageHelper.infoString(persister, id, source.getFactory() )
> );
> }
> }
> else {
> if ( log.isTraceEnabled() ) {
> log.trace(
> "refreshing " +
> MessageHelper.infoString( e.getPersister(), e.getId(), source.getFactory() )
> );
> }
> if ( !e.isExistsInDatabase() ) {
> throw new HibernateException( "this instance does not yet exist as a row in the database" );
> }
> persister = e.getPersister();
> id = e.getId();
> }
> // cascade the refresh prior to refreshing this entity
> // not applicable in stateless session: refreshedAlready.put(object, object);
> // new Cascade(CascadingAction.REFRESH, Cascade.BEFORE_REFRESH, source)
> // .cascade( persister, object, refreshedAlready );
> if ( e != null ) {
> EntityKey key = new EntityKey( id, persister, source.getEntityMode() );
> source.getPersistenceContext().removeEntity(key);
> // not applicable in stateless session: if ( persister.hasCollections() ) new EvictVisitor( source ).process(object, persister);
> }
> if ( persister.hasCache() ) {
> final CacheKey ck = new CacheKey(
> id,
> persister.getIdentifierType(),
> persister.getRootEntityName(),
> source.getEntityMode(),
> source.getFactory()
> );
> persister.getCache().remove(ck);
> }
>
> // not applicable in stateless session: evictCachedCollections( persister, id, source.getFactory() );
>
> String previousFetchProfile = source.getFetchProfile();
> source.setFetchProfile("refresh");
> Object result = persister.load( id, object, lockMode, source );
> source.setFetchProfile(previousFetchProfile);
>
> UnresolvableObjectException.throwIfNull( result, id, persister.getEntityName() );
> }
--
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