[GitHub] tomcat issue #41: Check and update session record if one already exists.

2017-02-06 Thread JohnKiel
Github user JohnKiel commented on the issue: https://github.com/apache/tomcat/pull/41 If you use SELECT FOR UPDATE, then you'll also need to start and commit a transaction, with the overhead that entails. If the record is modified or even deleted between the time the SELECT query and

[GitHub] tomcat issue #41: Check and update session record if one already exists.

2017-02-06 Thread ChristopherSchultz
Github user ChristopherSchultz commented on the issue: https://github.com/apache/tomcat/pull/41 You should use SELECT ... FOR UPDATE instead of SELECT / UPDATE. Much less code and transactionally-safe. Also, if you use SELECT ... FOR UPDATE, you can use ResultSet.moveToInsertRow to in