Subject: Grouper Developers Forum
RE: [grouper-dev] dbVersionDifferentFields and getAttributeOrNull interraction
- From: Chris Hyzer <>
- To: "" <>
- Cc: Grouper Dev <>
- Subject: RE: [grouper-dev] dbVersionDifferentFields and getAttributeOrNull interraction
- Date: Mon, 16 Mar 2009 01:33:31 -0400
- Accept-language: en-US
- Acceptlanguage: en-US
Ive been using dbVersion a bit, and I must say it is not an exact science… right now dbVersion is meant to be the copy of the data which is committed in the database.
It gets confusing when there are multiple operations in one transaction.
e.g. group is created, stored (not committed), updated and committed.
On the create, there is no need to worry about dbVersion, it is null. On the update, the dbVersion is still null. Maybe the hook wants to know the version of the object on the wire (but not committed), and what has changed in the update… dbVersion will not tell you that I started to add that to the API to a second dbVersion (transactional state), but it is too confusing I think for users.
One of the points of dbVersion is to reduce queries… but the exact DB version (in transaction or out of transaction), is always available by doing a query (in tx or out of). One point of confusion is a postCommit hook… what does dbVersion mean? Does it mean the state of the DB before the original edit which initiated the commit, or the tx state before the commit (if situation above where there are multiple updates before commit), or does it mean the current state in the DB (after the commit, but before the hook). Right now the object is cloned before going to the postCommit, so what you are getting is a point in time [currently of the first option I believe]. But if another postCommit hook edited the group and committed, it would not be reflected… maybe postCommit in general needs to go to the DB to get the real data so something is not done with stale information (e.g. one hook edits the data, and another edits the original data stepping on the toes of the other hook).
Anyways, probably need to think more about the complex cases to make sure there is a way for this to be accurate…
- RE: [grouper-dev] dbVersionDifferentFields and getAttributeOrNull interraction, Chris Hyzer, 03/16/2009
Archive powered by MHonArc 2.6.16.