[hibernate-commits] Hibernate SVN: r10689 - branches/Branch_3_2/Hibernate3/src/org/hibernate/impl
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Thu Nov 2 13:53:55 EST 2006
Author: steve.ebersole at jboss.com
Date: 2006-11-02 13:53:54 -0500 (Thu, 02 Nov 2006)
New Revision: 10689
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/impl/SessionImpl.java
Log:
HHH-2206 - SessionImpl serialization
Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/impl/SessionImpl.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/impl/SessionImpl.java 2006-11-02 18:53:25 UTC (rev 10688)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/impl/SessionImpl.java 2006-11-02 18:53:54 UTC (rev 10689)
@@ -1872,29 +1872,33 @@
* Used by JDK serialization...
*
* @param ois The input stream from which we are being read...
- * @throws IOException
- * @throws ClassNotFoundException
+ * @throws IOException Indicates a general IO stream exception
+ * @throws ClassNotFoundException Indicates a class resolution issue
*/
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
log.trace( "deserializing session" );
boolean isRootSession = ois.readBoolean();
+ connectionReleaseMode = ConnectionReleaseMode.parse( ( String ) ois.readObject() );
+ entityMode = EntityMode.parse( ( String ) ois.readObject() );
+ autoClear = ois.readBoolean();
+ flushMode = FlushMode.parse( ( String ) ois.readObject() );
+ cacheMode = CacheMode.parse( ( String ) ois.readObject() );
+ flushBeforeCompletionEnabled = ois.readBoolean();
+ autoCloseSessionEnabled = ois.readBoolean();
+ fetchProfile = ( String ) ois.readObject();
interceptor = ( Interceptor ) ois.readObject();
+
factory = SessionFactoryImpl.deserialize( ois );
listeners = factory.getEventListeners();
+
if ( isRootSession ) {
jdbcContext = JDBCContext.deserialize( ois, this, interceptor );
}
+
persistenceContext = StatefulPersistenceContext.deserialize( ois, this );
actionQueue = ActionQueue.deserialize( ois, this );
- entityMode = EntityMode.parse( ( String ) ois.readObject() );
- autoClear = ois.readBoolean();
- flushMode = FlushMode.parse( ( String ) ois.readObject() );
- cacheMode = CacheMode.parse( ( String ) ois.readObject() );
- flushBeforeCompletionEnabled = ois.readBoolean();
- autoCloseSessionEnabled = ois.readBoolean();
- connectionReleaseMode = ConnectionReleaseMode.parse( ( String ) ois.readObject() );
- fetchProfile = ( String ) ois.readObject();
+
enabledFilters = ( Map ) ois.readObject();
childSessionsByEntityMode = ( Map ) ois.readObject();
@@ -1917,7 +1921,7 @@
* Used by JDK serialization...
*
* @param oos The output stream to which we are being written...
- * @throws IOException
+ * @throws IOException Indicates a general IO stream exception
*/
private void writeObject(ObjectOutputStream oos) throws IOException {
if ( !jdbcContext.getConnectionManager().isReadyForSerialization() ) {
@@ -1927,22 +1931,26 @@
log.trace( "serializing session" );
oos.writeBoolean( rootSession == null );
+ oos.writeObject( connectionReleaseMode.toString() );
+ oos.writeObject( entityMode.toString() );
+ oos.writeBoolean( autoClear );
+ oos.writeObject( flushMode.toString() );
+ oos.writeObject( cacheMode.toString() );
+ oos.writeBoolean( flushBeforeCompletionEnabled );
+ oos.writeBoolean( autoCloseSessionEnabled );
+ oos.writeObject( fetchProfile );
// we need to writeObject() on this since interceptor is user defined
oos.writeObject( interceptor );
+
factory.serialize( oos );
+
if ( rootSession == null ) {
jdbcContext.serialize( oos );
}
+
persistenceContext.serialize( oos );
actionQueue.serialize( oos );
- oos.writeObject( entityMode.toString() );
- oos.writeBoolean( autoClear );
- oos.writeObject( flushMode.toString() );
- oos.writeObject( cacheMode.toString() );
- oos.writeBoolean( flushBeforeCompletionEnabled );
- oos.writeBoolean( autoCloseSessionEnabled );
- oos.writeObject( connectionReleaseMode.toString() );
- oos.writeObject( fetchProfile );
+
// todo : look at optimizing these...
oos.writeObject( enabledFilters );
oos.writeObject( childSessionsByEntityMode );
More information about the hibernate-commits
mailing list