ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(buffer);
out.writeObject(data);
out.close();
connection = factory.getDataSource().getConnection();
factory.getAdapter().doStoreData(connection, name + ":" + id, buffer.toByteArray());
} catch (Exception e) {
throw (IOException) new IOException("Error storing object").initCause(e);
} finally {
if (connection != null) {
try {