On Fri, Oct 06, 2006 at 03:08:00PM +0200, Stefan Manegold wrote:
On Fri, Oct 06, 2006 at 02:39:19PM +0200, Jan Rittinger wrote:
If this wsid is a concept that is strictly necessary for the update support (and nobody except me thinks that this bit shifting might be not the nicest solution) we could also think about getting rid of the ws and replacing it with the wsid. I just do not like the fact that there are two variables underway that have some side effects on each other.
To be honest, I'm still in the process of analyzing trying to understand, what all the flavors, pros, cons, and ideas behind having/using wsid are; hence, I cannot tell, whether it is "strictly necessary" or not.
As far as I understand so far, the basic idea behind the "bit shifting" is merely to store both the id of (and hence reference to) BAT ws as well as a unique identifier --- that is still valid after a query/transaction (and hence cannot simply be the ws BAT id, which might be re-used for a subsequent query/transaction) --- in one single atomic value.
Further, I agree, that having two related variables that need to be kept in sync and treated accordingly is not very handy for maintenance --- my guess is, that the current situation resulted from lack of time and fear to implement (something like) your (d) proposal; which I agree is "nicer" & "cleaner", but requires quite a lot of possibly error-prone code changes --- nevertheless, I might give it a try during the weekend ...
Stefan
So a fourth proposal (d) would be to replace the occurrences of ws by wsid. This would mean that *all* document accesses would have to include another indirection (even all path steps).
Well, I just realize that this actually only helps to save us from having function interfaces that expect/use either ws or wsid or both --- it does not help to get rid of the global ws variable: to exist throught the whole query, the ws BAT must either be a global variable or be persistent --- the latter is not possible, since ws is a BAT-of-BATs, and those cannot be persistent... ... I just recall, that we have something like "session" BATs --- I'll check whether that's an option (any help/hint is of course welcome ...) Stefan -- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |