← Back to team overview

drizzle-discuss team mailing list archive

Re: Improving the Engine API (was Re: New PBXT Drizzle-specific storage engine...)

 


On Dec 3, 2009, at 4:24 PM, Ann W. Harrison wrote:

Paul,

StorageEngine::commit(session, bool all)
StorageEngine::rollback(session, bool all)
I suggest we change this to the following:
StorageEngine::beginTransaction(session)
StorageEngine::commitTransaction(session)
StorageEngine::rollbackTransaction(session)
StorageEngine::startStatement(session)
StorageEngine::endStatement(session, abort = true/false)

You'll also want

StorageEngine::prepareTransaction(session)
StorageEngine::recover(session, XID *xids, unit length)
StorageEngine::commit_by_xid(session, XID* xid)
StorageEngine::rollback_by_xid(session, XID* xid)

Yes, you are right. These functions are actually already there.

But, currently we have:

prepare(session, bool all)

And as you say, this should changed to:

prepareTransaction(session)

because prepare with all=false does not make sense! (how do I prepare a statement transaction?)

Although it does have its use in the current API because:

prepare(session, all=false) is the same as prepare(session, all=true) when auto-commit is active!!! sh....!

And, of course, when the binlog is being used then I would expect (from my previous example):

StorageEngine::beginTransaction()
StorageEngine::startStatement()
handler->external_lock() // open-cursor t1
...UPDATE...
handler->external_lock(F_UNLCK) // close-cursor t1
StorageEngine::endStatement(false)
StorageEngine::prepareTransaction()
...FLUSH THE BINLOG...
StorageEngine::commitTransaction()

I am using the binlog example, but I am not sure how this translates to the new replication API ... Jay :)



Cheers,


Ann



--
Paul McCullagh
PrimeBase Technologies
www.primebase.org
www.blobstreaming.org
pbxt.blogspot.com






References