Пример #1
0
// Rollback rolls back the transaction
func (conn *Connection) Rollback() error {
	conn.srvMtx.Lock()
	defer conn.srvMtx.Unlock()
	return conn.environment.CheckStatus(
		C.OCITransRollback(conn.handle, conn.environment.errorHandle,
			C.OCI_DEFAULT), "Rollback")
}
Пример #2
0
func (tx *OCI8Tx) Rollback() error {
	tx.c.inTransaction = false
	if rv := C.OCITransRollback(
		(*C.OCISvcCtx)(tx.c.svc),
		(*C.OCIError)(tx.c.err),
		0); rv != C.OCI_SUCCESS {
		return ociGetError(tx.c.err)
	}
	return nil
}
Пример #3
0
func (tx *OCI8Tx) Rollback() error {
	rv := C.OCITransRollback(
		(*C.OCISvcCtx)(tx.c.svc),
		(*C.OCIError)(tx.c.err),
		0)
	if rv == C.OCI_ERROR {
		return ociGetError(tx.c.err)
	}
	return nil
}
Пример #4
0
func (conn *OCI8Conn) Rollback() error {
	if !conn.inTx {
		panic("Can't rollback, not in transaction?")
	}
	rv := C.OCITransRollback(
		(*C.OCISvcCtx)(conn.svc),
		(*C.OCIError)(conn.err),
		0)
	conn.inTx = false
	return conn.check(rv, "OCI8Conn.Rollback()")
}
Пример #5
0
// Rollback rolls back a transaction.
//
// Rollback is a member of the driver.Tx interface.
func (tx *Tx) Rollback() (err error) {
	tx.mu.Lock()
	defer tx.mu.Unlock()
	if tx == nil {
		return nil
	}
	tx.log(_drv.cfg.Log.Tx.Rollback)
	if err = tx.checkIsOpen(); err != nil {
		return err
	}
	if tx.ses == nil || tx.ses.srv == nil {
		return nil
	}
	defer tx.closeWithRemove()
	r := C.OCITransRollback(
		tx.ses.ocisvcctx,      //OCISvcCtx    *svchp,
		tx.ses.srv.env.ocierr, //OCIError     *errhp,
		C.OCI_DEFAULT)         //ub4          flags );
	if r == C.OCI_ERROR {
		return tx.ses.srv.env.ociError()
	}
	return nil
}
Пример #6
0
func (conn *Connection) rollback() C.sword {
	return C.OCITransRollback(conn.handle, conn.environment.errorHandle,
		C.OCI_DEFAULT)
}