From: Luke O. <lu...@me...> - 2003-04-26 18:45:03
|
Yes, you're right, I did end up asking for a transaction-like concept. Hmm. The challenge remains about the same to implement this across SQLObject, but I think your metaphor/example is right on. I'm wondering whether to rely on database-implemented transactions if possible, or whether to implement it regardless across SQLObject. But now I need to think. - Luke > Your motives are well-founded, but I don't entirely agree with your > choice of metaphor. > > What you're really looking for is transactions. > > Something like: > > from Transaction import Transaction > from invoicing import Client > > t = Transaction() > c = Client(1) > t.insertObject(c) > c.address1 = "100 New Street" > c.telephone = 4045551212 > c.fax = 4045551213 > t.saveChanges() > > the you can do things like: > > from Transaction import Transaction > from invoicing import Client > > t = Transaction() > c = Client(1) > t.insertObject(c) > c.address1 = "100 New Street" > > try: > c.telephone = 40455519 > except TelephoneErr, err: > print "Error saving telephone number:", err.value > t.rollback() > else: > t.commit() > > This kind of interface would not care about whether the backend > persistence is a database, or merely simple files and would provide > the kind of atomicity you're looking for, in a more "classical" > database style. > > What do you think? > > -- > Brad Bollenbach > BBnet.ca > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > -- i find your contempt for naked feet curious. |