The resource queue class (Queue) requires a transaction object. The signature is:
The deadlock support class (TxDag) has similar requirements:
Where blocked and running are “transaction” objects. I have not placed any constraint on the interfaces implemented by a “transaction” object, so this could be anything at all. Let me know if this would create any problems. My goal was a 2PL module without dependencies on other API – ideally something that can be reused easily.
I am definitely interested in looking at optimistic strategies – overall I think that they are really the best way to go. I have thought about how I would use optimistic CC in the GOM framework over jdbm, where I like the approach that some classes are able to achieve consistency without locking – much like you have suggested for btrees. Overall, there is nothing about the 2PL system that would make it impossible to use an optimistic concurrency control strategy, you just need to make sure that you validate if you do not obtain a lock.
[mailto:firstname.lastname@example.org] On Behalf Of Kevin Day
Sent: Thursday, March 23, 2006 4:46 PM
To: JDBM Developer listserv
Subject: re: [Jdbm-developer] Preliminary work on version manager is ready to commit...
I think I'll wait for Alex to weigh in and decide how best to proceed on where to check this stuff in to. Everything I've done up to now is from scratch, so licensing is not restricted.
The use (or non-use) of dbCache should be completely orthoganol to the transaction management in this design. When I talk about "writing to the store", I mean writing to any type of persistent storage. From the perspective of the proof of concept, whether the data winds up on the safe or in the actual db doesn't matter at all. For simplicity, I'm currently using a non page-based storage layer (basically, an array of typed variable length byte arrays).
Basically, dbCache (or the existing jdbm logging system) is used to ensure atomicity of groups of pages only. As long a you can guarantee that a given set of pages will either commit in their entirety or not at all, the multi-version algorithm takes care of transaction level isolation, atomicity and consistency. This does *not* require that all pages involved in a given transaction be written at the same time, though. There are certain groups of pages that do have to be written at the same time, so the smallest atomic write operation may involve 3 or 4 pages (a data page, a version page, a couple of translation pages). That same transaction may wind up making thousands of page writes over it's entire life, but they don't all have to be written at the same time.
Once that guarantee is in place, the version control system takes care of ensuring isolation, atomicity and consistency at the transaction level.
Durability is achieved by ensuring that all data involved in a given transaction has been written to the safe at the time of commit - but it's perfectly acceptable to have some of the data structures that are involved in multiple transactions. It's even possible for two active transactions to maintain changes to the same record at the same time - the concurrency management layer comes in at this point to determine whether a commit is allowed or not.
I have *not* written any thread synchronization or locking into the system at this point, so I'm relying on serial sequences of transaction operations for my unit testing. My goal here was more to prove that the concept would work, and provide a test bed so we could come up with transaction sequences that we thought might give us problems.
I'm pretty sure that we can implement 2PL on the logical records of the versioning system (it seems to me that concurrency control is really involved in the logical state of the database, not the physical state). I'm not sure where the appropriate place to actually look for deadlocks is, but I'm sure that will fall out as we start looking at the overall architecture. Does the 2PL system require that a transaction identifier (or transaction object itself) be passed in to the lock request?
Dring the development of the 2PL system, did you come across any ways of abstracting the design to easily support both 2PL and optimistic locking?
------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Jdbm-developer mailing list Jdbmemail@example.com https://lists.sourceforge.net/lists/listinfo/jdbm-developer