|
From: <hib...@li...> - 2006-06-02 20:14:34
|
Author: ste...@jb...
Date: 2006-06-02 16:14:17 -0400 (Fri, 02 Jun 2006)
New Revision: 9983
Modified:
trunk/Hibernate3/src/org/hibernate/impl/SessionFactoryImpl.java
Log:
minor
Modified: trunk/Hibernate3/src/org/hibernate/impl/SessionFactoryImpl.java
===================================================================
--- trunk/Hibernate3/src/org/hibernate/impl/SessionFactoryImpl.java 2006-06-02 19:47:51 UTC (rev 9982)
+++ trunk/Hibernate3/src/org/hibernate/impl/SessionFactoryImpl.java 2006-06-02 20:14:17 UTC (rev 9983)
@@ -1032,10 +1032,26 @@
// this reference within the same JVM, so simply writing out the
// uuid is enough
oos.writeUTF( uuid );
+ oos.writeBoolean( name != null );
+ if ( name != null ) {
+ oos.writeUTF( name );
+ }
}
+ /**
+ * Custom deserialization hook used during Session deserialization.
+ *
+ * @param ois The stream from which to "read" the factory
+ * @throws IOException
+ */
static SessionFactoryImpl deserialize(ObjectInputStream ois) throws IOException, ClassNotFoundException {
String uuid = ois.readUTF();
+ boolean isNamed = ois.readBoolean();
+ if ( isNamed ) {
+ // todo : potentially use name for lookups on deserialization;
+ // needed for clustered failover of a session (i.e. stateful session bean)
+ String name = ois.readUTF();
+ }
Object result = SessionFactoryObjectFactory.getInstance( uuid );
if ( result == null ) {
throw new InvalidObjectException( "could not locate session factory by uuid [" + uuid + "] during session deserialization" );
|