ColumnNameCache.columnNameToIndexCache map should be synchronized

Description

When I activate the result set wapper, hibernate.jdbc.wrap_result_sets=true, I can have a stacktrace such as :

####<Dec 15, 2010 8:44:27 PM CET> <Error> <WebLogicServer> <efa-bench> <decalog_server> <[ACTIVE] ExecuteThread: '29' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1292442267345> <BEA-000337> <[STUCK] ExecuteThread: '21' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy
for "602" seconds working on the request "weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl@73907390", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
java.util.HashMap.findNonNullKeyEntry(HashMap.java:526)
java.util.HashMap.getEntry(HashMap.java:510)
java.util.HashMap.get(HashMap.java:496)
org.hibernate.jdbc.ColumnNameCache.getIndexForColumnName(ColumnNameCache.java:52)
org.hibernate.jdbc.ResultSetWrapper.findColumn(ResultSetWrapper.java:84)
org.hibernate.jdbc.ResultSetWrapper.getString(ResultSetWrapper.java:248)
org.hibernate.type.StringType.get(StringType.java:18)
org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2091)
org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
org.hibernate.loader.Loader.getRow(Loader.java:1206)
org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
org.hibernate.loader.Loader.doQuery(Loader.java:701)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
org.hibernate.loader.Loader.loadCollection(Loader.java:1998)
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:63)
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1717)
org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:109)
org.hibernate.collection.PersistentSet.size(PersistentSet.java:139)

I think that columnNameToIndexCache map should be synchronized.
I got the exception with 3.2.7 but I had a look at the latest version and the bug is still there.

Environment

AIX, IMB J9 jvm

Activity

Show:
FabianL
September 15, 2011, 1:53 PM

Just saw the very same happen at a customer (but I do not know the used version)

For 4.0 I am going to provide a patch via GIT, please consider backporting

Strong Liu
September 15, 2011, 6:28 PM

patch applied, thanks

Brett Meyer
March 7, 2014, 10:08 PM

Bulk closing tickets resolved in released versions

Assignee

Strong Liu

Reporter

Ivan Popov

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure