private static BinlogEventV4 formXidEvent(int txId){
  BinlogEventV4HeaderImpl xidEventV4Header=new BinlogEventV4HeaderImpl();
  xidEventV4Header.setTimestamp(System.currentTimeMillis());
  xidEventV4Header.setEventType(MySQLConstants.XID_EVENT);
  xidEventV4Header.setServerId(1);
  XidEvent xidEvent=new XidEvent(xidEventV4Header);
  xidEvent.setXid(txId);
  return xidEvent;
}

private static BinlogEventV4 formXidEvent ( int txId ) { BinlogEventV4HeaderImpl xidEventV4Header = new BinlogEventV4HeaderImpl ( ) ; xidEventV4Header . setTimestamp ( System . currentTimeMillis ( ) ) ; xidEventV4Header . setEventType ( MySQLConstants . XID_EVENT ) ; xidEventV4Header . setServerId ( 1 ) ; XidEvent xidEvent = new XidEvent ( xidEventV4Header ) ; xidEvent . setXid ( txId ) ; return xidEvent ; }
the final event in the case innodb transactions is the xid event . for myisam the final event would be a query event with a " commit " / " rollback " sql
