Skip to content

Commit

Permalink
keep table from getting too big by mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Dec 27, 2007
1 parent ad2f3c4 commit c26a8ae
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -12,6 +12,8 @@
public class DerbyFunctions {

private static final String CURRENT_CONNECTION_URL = "jdbc:default:connection";

private static final int MAX_TABLE_SIZE = 200;

private static Hashtable<String, Boolean> syncDisabledTable = new Hashtable<String, Boolean>();

Expand All @@ -28,6 +30,9 @@ public static int setSyncDisabled(int disabledIndicator) throws SQLException {
syncDisabledTable.remove(getTransactionId());
return 0;
} else {
if (syncDisabledTable.size() >= MAX_TABLE_SIZE) {
clean();
}
syncDisabledTable.put(getTransactionId(), Boolean.TRUE);
return 1;
}
Expand Down

0 comments on commit c26a8ae

Please sign in to comment.