*/
public int prepare(Xid xid) throws XAException {
StandardXAStatefulConnection stateCon = checkPreparedState (xid);// do generic state checking etc.
ConnectionExtensions con
= (ConnectionExtensions)stateCon.con; // get the InstantDB connection
int status = con.prepare(); // prepare to commit
if (status == XA_RDONLY) { // if transaction didn't update the database
xaDataSource.freeConnection (xid, false); // free the connection
} // if
return status;
}