[TransWarp] TableDM proof of concept, request for comments

Phillip J. Eby pje at telecommunity.com
Thu Oct 9 19:10:56 EDT 2003

At 04:31 PM 10/9/03 -0500, darryl wrote:
> > At 12:36 PM 10/9/03 -0700, John Landahl wrote:
> >
> >>See the attached tabledm.py for the code, and feel free to offer any
> >> criticism or suggestions.
> >
> > A few issues I see:
> >
> > * ID generation isn't multi-user safe; if two processes generate an ID
> > at  the same time, one will fail.
>* This is a shortcoming of the ID generation in the bullitens sample app
>in general is it not?

It's fine for SQLite, which is what the bulletins app uses, as SQLite is 
strictly single-user.  And SQLite doesn't really offer any other mechanism 
for doing this, I believe.

However, between you and John I've now realized that it's probably a bad 
thing to have in the example!  (It probably should at least have a comment 
warning people not to do it with multi-user databases.)

>* Different RDBM's tend to have different methods of generating
>'autoincrement' fields that are (or might be) transaction safe so any
>classes that attempt to abstract this would have to take this into account

Yes, this is probably going to need some kind of ID-generation component 
plugin, possibly with an extension to the existing ISQLConnection interface 
so that DB connections can abstract this in some way.

The hard part about such an abstraction is that most databases have 
seriously different ways to do this, and not just in the sense that the SQL 
used is different.  :(

More information about the PEAK mailing list