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
This commit is contained in:
mdb
2007-05-23 18:20:08 +00:00
parent 47e9790561
commit b18001332f
@@ -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<T>(null, key, key) {
return _ctx.invoke(new CachingModifier<T>(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 {