Best practice for entity update.

2007-02-09 Thread Christopher Thill
I wanted to ask a question about the best way to prevent users overwriting each others changes when updating the database. If you use the simplest way IntakeTool intake = (IntakeTool) context.get(ConstSpr.INTAKE_STRING); Group group =

Database independent error trapping.

2007-02-09 Thread Christopher Thill
I am wondering if there is a way to do database independent error trapping. For example on a table/object that has a unique key I just invoke the .save() method and and trap any exception. I look at the exception to see if it was a duplicate value in the unique column that caused the error and

AW: Best practice for entity update.

2007-02-09 Thread Thoralf Rickert
Hi! If it isn't possible to use a transaction connection you can use a timestamp column to verify if the row is changed in the database. Before saving the instance you can read the timestamp column from the DB and compare it with the timestamp that is set in your instance (this should be done

email

2007-02-09 Thread jill han
Please unblock the email from Torque-user@db.apache.org Turbine-user@jakarta.apache.org Velocity-user@jakarta.apache.org Thanks.

RE: Database independent error trapping.

2007-02-09 Thread Greg Monroe
Three or four years ago, I did some coding on a pre-Torque system that tried to deal with this issue. One major problem I remember is that there is no true standard for SQL error codes. And what standards there are don't seem to be implimented very well (or at all). To add to the confusion,