예제 #1
0
파일: oci8.go 프로젝트: AsamQi/go-oci8
func (tx *OCI8Tx) Commit() error {
	tx.c.inTransaction = false
	if rv := C.OCITransCommit(
		(*C.OCISvcCtx)(tx.c.svc),
		(*C.OCIError)(tx.c.err),
		0); rv != C.OCI_SUCCESS {
		return ociGetError(tx.c.err)
	}
	return nil
}
예제 #2
0
파일: oci8.go 프로젝트: jprobinson/go-oci8
func (tx *OCI8Tx) Commit() error {
	rv := C.OCITransCommit(
		(*C.OCISvcCtx)(tx.c.svc),
		(*C.OCIError)(tx.c.err),
		0)
	if rv == C.OCI_ERROR {
		return ociGetError(tx.c.err)
	}
	return nil
}
예제 #3
0
파일: oci8.go 프로젝트: kwargs/go-oci8
func (conn *OCI8Conn) Commit() error {
	if !conn.inTx {
		panic("Can't commit, not in transaction?")
	}
	rv := C.OCITransCommit(
		(*C.OCISvcCtx)(conn.svc),
		(*C.OCIError)(conn.err),
		0)
	conn.inTx = false
	return conn.check(rv, "OCI8Conn.Commit()")
}
예제 #4
0
파일: connection.go 프로젝트: viney/goracle
// Commit commits the transaction on the connection.
func (conn *Connection) Commit() error {
	// make sure we are actually connected
	if !conn.IsConnected() {
		return nil //?
	}

	conn.srvMtx.Lock()
	defer conn.srvMtx.Unlock()
	// perform the commit
	//Py_BEGIN_ALLOW_THREADS
	if err := conn.environment.CheckStatus(
		C.OCITransCommit(conn.handle, conn.environment.errorHandle,
			C.ub4(conn.commitMode)), "Commit"); err != nil {
		return err
	}
	conn.commitMode = C.OCI_DEFAULT
	//Py_END_ALLOW_THREADS
	return nil
}
예제 #5
0
파일: tx.go 프로젝트: ricsmania/ora
// Commit commits the transaction.
//
// Commit is a member of the driver.Tx interface.
func (tx *Tx) Commit() (err error) {
	tx.mu.Lock()
	defer tx.mu.Unlock()
	if tx == nil {
		return nil
	}
	tx.log(_drv.cfg.Log.Tx.Commit)
	if err = tx.checkIsOpen(); err != nil {
		return err
	}
	defer tx.closeWithRemove()
	r := C.OCITransCommit(
		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
}