active xa connection rollback fix (#672)

diff --git a/pkg/datasource/sql/conn_xa.go b/pkg/datasource/sql/conn_xa.go
index f557c1e..c4767bc 100644
--- a/pkg/datasource/sql/conn_xa.go
+++ b/pkg/datasource/sql/conn_xa.go
@@ -257,11 +257,11 @@
 }
 
 func (c *XAConn) end(ctx context.Context, flags int) error {
-	err := c.termination(c.xaBranchXid.String())
+	err := c.xaResource.End(ctx, c.xaBranchXid.String(), flags)
 	if err != nil {
 		return err
 	}
-	err = c.xaResource.End(ctx, c.xaBranchXid.String(), flags)
+	err = c.termination(c.xaBranchXid.String())
 	if err != nil {
 		return err
 	}