Fixed SQL for saving cookies. Handy syntax, that
"insert ... on duplicate key" stuff. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@125 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -116,9 +116,9 @@ public class GameCookieRepository extends SimpleRepository
|
||||
|
||||
} else {
|
||||
PreparedStatement stmt = conn.prepareStatement(
|
||||
"update GAME_COOKIES set COOKIE=?" +
|
||||
" where GAME_ID=" + gameId +
|
||||
" and USER_ID=" + userId);
|
||||
"insert into GAME_COOKIES (GAME_ID, USER_ID, COOKIE) " +
|
||||
"values (" + gameId + "," + userId + ",?) " +
|
||||
"on duplicate key update COOKIE=values(COOKIE)");
|
||||
try {
|
||||
stmt.setBytes(1, cookie);
|
||||
stmt.executeUpdate();
|
||||
|
||||
Reference in New Issue
Block a user