V2Stats Problem With JTDS

I believe there is a problem with the V2Stats plugin an the JTDS SQL Server driver.

When I first installed version 1.1.0 of the plugin it failed to automatically create all the nessicary tables. This wasn’'t a big deal because I still had the raw table creation script that you guys posted a few weeks ago.

However, now the stats plugin seems to be having some problems removing old entries out of the stats tables.

This was in my error log the other day:

2006.01.07 03:12:39 [com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statist icsDAO.java:706)

]

java.sql.SQLException: I/O Error: Connection reset by peer: socket write error

at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1049)

at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:478)

at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.j ava:475)

at com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statisti csDAO.java:704)

at com.version2software.wildfire.plugins.database.StatisticsDAO.insertStatistic(St atisticsDAO.java:460)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.savePackets(PacketCountCollector.java:105)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.run(PacketCountCollector.java:125)

Caused by: java.net.SocketException: Connection reset by peer: socket write error

at java.net.SocketOutputStream.socketWrite0(Native Method)

at java.net.SocketOutputStream.socketWrite(Unknown Source)

at java.net.SocketOutputStream.write(Unknown Source)

at java.io.DataOutputStream.write(Unknown Source)

at net.sourceforge.jtds.jdbc.SharedSocket.sendNetPacket(SharedSocket.java:656)

at net.sourceforge.jtds.jdbc.RequestStream.putPacket(RequestStream.java:560)

at net.sourceforge.jtds.jdbc.RequestStream.flush(RequestStream.java:508)

at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1036)

… 6 more

2006.01.07 03:12:39 [com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statist icsDAO.java:706)

]

java.sql.SQLException: Invalid state, the Connection object is closed.

at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1494)

at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java :2177)

at org.jivesoftware.database.AbstractConnection.prepareStatement(AbstractConnectio n.java:36)

at com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statisti csDAO.java:702)

at com.version2software.wildfire.plugins.database.StatisticsDAO.insertStatistic(St atisticsDAO.java:461)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.savePackets(PacketCountCollector.java:105)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.run(PacketCountCollector.java:125)

2006.01.07 03:12:40 [com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statist icsDAO.java:706)

]

java.sql.SQLException: Invalid state, the Connection object is closed.

at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1494)

at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java :2177)

at org.jivesoftware.database.AbstractConnection.prepareStatement(AbstractConnectio n.java:36)

at com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statisti csDAO.java:702)

at com.version2software.wildfire.plugins.database.StatisticsDAO.insertStatistic(St atisticsDAO.java:462)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.savePackets(PacketCountCollector.java:105)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.run(PacketCountCollector.java:125)

2006.01.07 03:12:40 [com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statist icsDAO.java:706)

]

java.sql.SQLException: Invalid state, the Connection object is closed.

at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1494)

at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java :2177)

at org.jivesoftware.database.AbstractConnection.prepareStatement(AbstractConnectio n.java:36)

at com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statisti csDAO.java:702)

at com.version2software.wildfire.plugins.database.StatisticsDAO.insertStatistic(St atisticsDAO.java:463)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.savePackets(PacketCountCollector.java:105)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.run(PacketCountCollector.java:125)

2006.01.07 03:12:40 [com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statist icsDAO.java:706)

]

java.sql.SQLException: Invalid state, the Connection object is closed.

at net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1494)

at net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java :2177)

at org.jivesoftware.database.AbstractConnection.prepareStatement(AbstractConnectio n.java:36)

at com.version2software.wildfire.plugins.database.StatisticsDAO.deleteOld(Statisti csDAO.java:702)

at com.version2software.wildfire.plugins.database.StatisticsDAO.insertStatistic(St atisticsDAO.java:464)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.savePackets(PacketCountCollector.java:105)

at com.version2software.wildfire.plugins.collector.PacketCountCollector$PacketCoun tThread.run(PacketCountCollector.java:125)

/code

Thanks for looking into this.

Hi Caleb,

Thank you for the bug report, we’'ll look into the problem immediately. Which version of SQL Server and JTDS SQL Server driver are you using?

Thanks,

Ryan

We are running SQL Server 2000 SP4 (08.00.2039) and the JTDS driver that is bundled with Wildfire, 1.2.

Thanks for the (extremely!) quick response.

Hi Caleb,

Is this an error you’'re seeing constantly or was it just a one time thing?

Thanks,

Ryan

This is the first and only time I have seen this error.

HI Caleb,

This is the first and only time I have seen this error.

Based on the error message, the fact that you’'ve only seen this once and or not being able to reproduce the problem locally, we believe this errorwas the result of the connection to your database going down when the plugin attempted to delete the old records. A nice thing about the design of the plugin is that it will “catch up” during the next insert/update/delete cycle.

Hope that helps,

Ryan

You know what, you’'re right. I just looked at the Info.log and the server was shutting down at 3:12 AM (due to a Windows Update Services hotfix install). Thanks again and sorry for the false alarm.

Thanks again and sorry for the false alarm.

No problem. Glad to hear it’'s working.