/** * Used by JDK serialization... * * @param oos The output stream to which we are being written... * @throws IOException Indicates a general IO stream exception */ private void writeObject(ObjectOutputStream oos) throws IOException { if ( ! transactionCoordinator.getJdbcCoordinator().getLogicalConnection().isReadyForSerialization() ) { throw new IllegalStateException( "Cannot serialize a session while connected" ); } LOG.trace( "Serializing session" ); oos.defaultWriteObject(); oos.writeObject( connectionReleaseMode.toString() ); oos.writeBoolean( autoClear ); oos.writeBoolean( autoJoinTransactions ); oos.writeObject( flushMode.toString() ); oos.writeObject( cacheMode.name() ); oos.writeBoolean( flushBeforeCompletionEnabled ); oos.writeBoolean( autoCloseSessionEnabled ); // we need to writeObject() on this since interceptor is user defined oos.writeObject( interceptor ); factory.serialize( oos ); transactionCoordinator.serialize( oos ); persistenceContext.serialize( oos ); actionQueue.serialize( oos ); // todo : look at optimizing these... oos.writeObject( loadQueryInfluencers ); }
/** * Used by JDK serialization... * * @param oos The output stream to which we are being written... * @throws IOException Indicates a general IO stream exception */ private void writeObject(ObjectOutputStream oos) throws IOException { if ( ! transactionCoordinator.getJdbcCoordinator().getLogicalConnection().isReadyForSerialization() ) { throw new IllegalStateException( "Cannot serialize a session while connected" ); } LOG.trace( "Serializing session" ); oos.defaultWriteObject(); oos.writeObject( connectionReleaseMode.toString() ); oos.writeBoolean( autoClear ); oos.writeBoolean( autoJoinTransactions ); oos.writeObject( flushMode.toString() ); oos.writeObject( cacheMode.name() ); oos.writeBoolean( flushBeforeCompletionEnabled ); oos.writeBoolean( autoCloseSessionEnabled ); // we need to writeObject() on this since interceptor is user defined oos.writeObject( interceptor ); factory.serialize( oos ); transactionCoordinator.serialize( oos ); persistenceContext.serialize( oos ); actionQueue.serialize( oos ); // todo : look at optimizing these... oos.writeObject( loadQueryInfluencers ); }