powered by Jive Software

Sequence Manager(Bug in MS Sql Server Driver 1.2.2 in regards to executeUpdate)

First thanks for your help, and I apologize if I sound off, I’m still getting use to this.

I’ve been working to get the monitoring plugin working with open fire, we’re using Microsoft SQL Server 2008 R2 as our database, with the default MS Sql Server Driver 1.2.2.

In the Sequence Manager.getNextBlock, there’s a check to see if ofID column.id was updated via “pstmt.executeUpdate()”, the function should return 1 if a column was updated, and 0 if not however, there’s a bug in MS Sql Server Driver 1.2.2 which makes it always return 0 regardless if it’s been updated or not.

Does anyone know a work around, supposively a latter driver should fixed this issue however, I’m unsure on how to install a latter version.

Again thanks for your help.

download the driver from here. I think 1.3.1 is the latest stable

http://jtds.sourceforge.net/

stop openfire

located jtds.jar … it should be in \Program Files (x86)\Openfire\lib

rename it to something like jtds.jar.old

From the zip you downloaded earlier, extract jtds-1.3.1.jar

copy it to \Program Files (x86)\Openfire\lib and rename it to jtds.jar

start openfire

You should now be running the current driver.

Thanks for the help.

Shortly after posting this I was able to update the driver however, executeUpdate still only give me a 0 despite the column being updated within ofID, and the admin console reflecting the change to jtds-1.3.1.

2014.08.21 14:42:56 org.jivesoftware.database.SequenceManager - The object: class org.jivesoftware.openfire.archive.Conversation the id: 50

2014.08.21 14:42:56 org.jivesoftware.database.SequenceManager - Retrieve type: 50

2014.08.21 14:42:56 org.jivesoftware.database.SequenceManager - The loaded id: 271

2014.08.21 14:42:56 org.jivesoftware.database.SequenceManager - The new id: 272

2014.08.21 14:42:56 org.jivesoftware.database.SequenceManager - Column updated result: 0

Before Database update:

idType = 50 id = 271

After Database update:

idType = 50 id =272

The above is suppose to show that we’re going to the right table, and the right entry however, executeUpdate still only returns 0. Do you have any ideas for a work around potentially.

More Details:

I’m using a stored procedure withinside the sql server. Then calling it from Open fire with

private static final String UPDATE_ID = “EXEC GW.app_UpdateOpenfireIDbyTypeID ?,?,?”;

pstmt = con.prepareStatement(UPDATE_ID);

pstmt.setLong(1, newID);

pstmt.setInt(2, type);

pstmt.setLong(3, currentID);

int result = pstmt.executeUpdate();

If this gives you a better idea of what I’m doing, and how to solve the issue please let me know.

Thanks again!