From 3dfbd3bc641e2b5cb945caec854fd71a1eccdd6b Mon Sep 17 00:00:00 2001 From: N3X15 Date: Tue, 7 Jun 2011 16:55:23 -0700 Subject: [PATCH] Perform a NOP if SENDING is empty to prevent "no packets sent" errors --- .../taylorkelly/bigbrother/datasource/DataBlockSender.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/me/taylorkelly/bigbrother/datasource/DataBlockSender.java b/src/main/java/me/taylorkelly/bigbrother/datasource/DataBlockSender.java index 2c5d4bf..6a674ce 100644 --- a/src/main/java/me/taylorkelly/bigbrother/datasource/DataBlockSender.java +++ b/src/main/java/me/taylorkelly/bigbrother/datasource/DataBlockSender.java @@ -44,6 +44,12 @@ public static void offer(BBDataBlock dataBlock) { private static boolean sendBlocksSQL(Collection collection, WorldManager manager) { // Try to refactor most of these into the table managers. + // Perform a NOP if nothing's happened. + if(SENDING.size()==0) { + // Hopefully this'll work with all DBMSes or I'll start choking bitches. + BBDB.executeQuery("SELECT 1"); + return true; + } //H2 fix... if (BBDB.usingDBMS(DBMS.H2)) { for (BBDataBlock block : collection) {