"Leslie P. Polzer" <[email protected]> writes: >> ERROR: no such savepoint > > db=# begin; > BEGIN > db=# savepoint my_sp; > SAVEPOINT > db=# insert into foo values (1); > ERROR: duplicate key value violates unique constraint "foo_pkey" > db=# rollback to my_sp; > ROLLBACK > db=# commit; > COMMIT
You're right! I stupidly used an invalid savepoint name when rolling back. It does work. Ok, I will try to use that as a workaround. Thanks! >> The more I think about it, the more I am convinced that per-request >> transactions are a bad idea. In case of CLSQL stores, if something goes >> wrong they will leave your database in a consistent state, but your >> model will most likely not agree with the database anymore, because we >> don't have STM like Clojure does. > > That's right. I don't use per-request txns either. > >> To put it another way, your perform updates to your model, and call >> persist-object to store your updates. If the database rejects your >> changes (due to violated constraints for example, or a race condition >> when using SERIALIZABLE isolation level), you normally have no way of >> restoring your model to the state from the beginning of the >> transaction. And this means is that the current way of doing things in >> Weblocks is broken. > > Suggestions later accompanied by patches are welcome... I know -- but I can't do everything. In this case, I don't have the time and don't feel competent enough. I was hoping for feedback from smart people (thanks, Leslie!) and that someone would eventually read this, step in and do The Right Thing, whatever that might be. --J. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "weblocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/weblocks?hl=en -~----------~----~----~----~------~----~------~--~---
