[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6162) SessionFactory in QueryKey

Julian Duta (JIRA) noreply at atlassian.com
Fri Sep 23 12:51:35 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43680#comment-43680 ] 

Julian Duta commented on HHH-6162:
----------------------------------

I am having the same problem even with 3.5.

This is a serious issue for people using @EmbeddedId or any other org.hibernate.type.ComponentType PK with remote caches since the SessionFactory does not exist on the remote JVM and it's not needed either.

Can you guys suggest a solution to bypass this functionality? How can naming the SF solve this since the remote JVM has no JNDI context.

Thanks!

> SessionFactory in QueryKey
> --------------------------
>
>                 Key: HHH-6162
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6162
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 3.6.2, 4.0.0.Alpha1, 3.6.3, 4.0.0.Alpha2
>         Environment: Hibernate 3.6.2, Postgresql 8.3 
>            Reporter: Pawel Omelko
>
> I guess that after improvement HHH-5138, a ManyToOneType.java (and many other types) has reference to SessionFactory (by TypeFactory.TypeScope scope field). And now QueryKey, which contains Type[] positionalParameterTypes field, contains also SessionFactory - eg. ManyToOneType. So now we can find SessionFactory in QueryCache elements, which unnecessarily increase memory usage. There is another problem when cache replication is used (ehcache via RMI), I've got an exception during SessionFactory deserialization in receiver node:
> Apr 27 06:17:58 WARN net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator:320  - Unable to send message to remote peer.  Message was: null
> Apr 27 06:17:58 java.lang.NullPointerException
> Apr 27 06:17:58 at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
> Apr 27 06:17:58 at org.hibernate.impl.SessionFactoryObjectFactory.getNamedInstance(SessionFactoryObjectFactory.java:159)
> Apr 27 06:17:58 at org.hibernate.impl.SessionFactoryImpl.readResolve(SessionFactoryImpl.java:753)
> Apr 27 06:17:58 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> Apr 27 06:17:58 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> Apr 27 06:17:58 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> Apr 27 06:17:58 at java.lang.reflect.Method.invoke(Method.java:597)
> Apr 27 06:17:58 at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1061)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1762)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> Apr 27 06:17:58 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> Apr 27 06:17:58 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
> Apr 27 06:17:58 at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
> Apr 27 06:17:58 at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
> Apr 27 06:17:58 at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
> Apr 27 06:17:58 at org.hibernate.cache.QueryKey.readObject(QueryKey.java:192)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list