On Mon, 2006-12-11 at 23:52 +0300, Oleg Broytmann wrote: > On Mon, Dec 11, 2006 at 03:37:38PM -0500, David Turner wrote: > > > Shouldn't it be considered a bug in the user program if it access the > > > DB > > > during row creation? > > > > I don't see why it should be. > > Because accessing the DB during row creation when the "row" is actually > a set of rows exposes the inconsistent state of the DB, and SQLObject > certainly cannot prevent this.
Sure it can -- using transactions in the way I suggested, or using a liveness marker which is atomically set at the end of creation. Either of these would work. > > The actual use case I had in mind was that a table's elements acted as a > > sortable list, so the table has a column sort_index, which is unique. I > > want to set the sort_index on new elements to be one plus the max of the > > sort_index on the old elements -- that is, new elements should appear at > > the end of the list. > > "sort_index" should be an autoincremented int. Thus the DB guarantees > both consistency and speed. That would be nice, but MySQL only allows one autoincremented column per table. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ sqlobject-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
