This commit is contained in:
@@ -372,10 +372,14 @@ public final class DataDefaultSource implements DataSource, Function<Class, Enti
|
|||||||
final String oldTable = info.table;
|
final String oldTable = info.table;
|
||||||
final String newTable = info.getTable(values[0]);
|
final String newTable = info.getTable(values[0]);
|
||||||
if (!info.tables.contains(newTable)) {
|
if (!info.tables.contains(newTable)) {
|
||||||
Statement st = conn.createStatement();
|
try {
|
||||||
st.execute(info.tablecopySQL.replace("${newtable}", newTable).replace("${oldtable}", oldTable));
|
Statement st = conn.createStatement();
|
||||||
st.close();
|
st.execute(info.tablecopySQL.replace("${newtable}", newTable).replace("${oldtable}", oldTable));
|
||||||
info.tables.add(newTable);
|
st.close();
|
||||||
|
info.tables.add(newTable);
|
||||||
|
} catch (SQLException sqle) { //多进程并发时可能会出现重复建表
|
||||||
|
logger.log(Level.SEVERE, "create table(" + info.tablecopySQL.replace("${newtable}", newTable).replace("${oldtable}", oldTable) + ") error", sqle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prestmt.close();
|
prestmt.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user