void reserveSpaceInStore ( ObjectManagerByteArrayOutputStream byteArrayOutputStream ) throws ObjectManagerException { // During recovery we use the defeault mechanism because we have not pre-reserved the space, // store full exceptions are supressed during recovery. if ( owningToken . getObjectStore ( ) . getObjectManagerState ( ) . getObjectManagerStateState ( ) == ObjectManagerState . stateReplayingLog ) super . reserveSpaceInStore ( byteArrayOutputStream ) ; else { // Adjust the space reserved in the ObjectStore to reflect what we just serialized // and will eventually give to the ObjectStore. // We reserve the largest size even if the ManagedObject has become smaller, this is because // there may be a larger version of this Object still about to commit. int currentSerializedSize = byteArrayOutputStream . getCount ( ) + owningToken . objectStore . getAddSpaceOverhead ( ) ; if ( currentSerializedSize > latestSerializedSize ) { latestSerializedSizeDelta = currentSerializedSize - latestSerializedSize ; reservedSpaceInStore = reservedSpaceInStore - latestSerializedSizeDelta ; latestSerializedSize = currentSerializedSize ; } // if (currentSerializedSize > latestSerializedSize). } }
Modifiy the behaviour of the ManagedObject ObjectStore space reservation by taking storage from the previously allocated reservedSpaceInStore rather than the store itself this avoids the possibility of seeing an ObjectStoreFull exception here .