ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(new ByteArrayOutputStream());
oos.writeObject(obj);
} catch (IOException e) {
throw new JDOFatalException(e.getMessage(), e);
} finally {
if (oos != null) {
try {
oos.close();
} catch (IOException e) {
throw new JDOFatalException(e.getMessage(), e);
}
}
}
break;
}
case SERIALIZEDATASTORE:
case SERIALIZEOPTIMISTIC:
{
ObjectOutputStream oos = null;
try {
oos = new ObjectOutputStream(new ByteArrayOutputStream());
oos.writeObject(obj);
} catch (IOException e) {
throw new JDOFatalException(e.getMessage(), e);
} finally {
if (oos != null) {
try {
oos.close();
} catch (IOException e) {
throw new JDOFatalException(e.getMessage(), e);
}
}
}
break;
}