Allocate objects only when it's necessary
Closes gh-23036
This commit is contained in:
committed by
Sam Brannen
parent
6f2f5bb8c1
commit
6964ed33bf
@@ -484,12 +484,12 @@ public abstract class AbstractJdbcInsert {
|
||||
//Get the key
|
||||
Statement keyStmt = null;
|
||||
ResultSet rs = null;
|
||||
Map<String, Object> keys = new HashMap<>(2);
|
||||
try {
|
||||
keyStmt = con.createStatement();
|
||||
rs = keyStmt.executeQuery(keyQuery);
|
||||
if (rs.next()) {
|
||||
long key = rs.getLong(1);
|
||||
Map<String, Object> keys = new HashMap<>(2);
|
||||
keys.put(getGeneratedKeyNames()[0], key);
|
||||
keyHolder.getKeyList().add(keys);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user