From b18001332f3a1f40935c1fde84b9ab3a372c3118 Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 23 May 2007 18:20:08 +0000 Subject: [PATCH] Oops, we were using _result to pass the record into the modifier in the first place. We'll continue to do that and clear out _result during invoke() which is a wee bit clearer anyway. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2105 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/jdbc/depot/DepotRepository.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java/com/samskivert/jdbc/depot/DepotRepository.java b/src/java/com/samskivert/jdbc/depot/DepotRepository.java index b29a6215..9aa77bb2 100644 --- a/src/java/com/samskivert/jdbc/depot/DepotRepository.java +++ b/src/java/com/samskivert/jdbc/depot/DepotRepository.java @@ -284,10 +284,11 @@ public class DepotRepository if (key == null) { throw new IllegalArgumentException("Can't update record with null primary key."); } - // by passing null as "result" we flush the record from the cache and don't restore it - return _ctx.invoke(new CachingModifier(null, key, key) { + return _ctx.invoke(new CachingModifier(record, key, key) { public int invoke (Connection conn) throws SQLException { PreparedStatement stmt = marsh.createUpdate(conn, _result, key, modifiedFields); + // clear out _result so that we don't rewrite this partial record to the cache + _result = null; try { return stmt.executeUpdate(); } finally {