JBoss Community

JDBCPersistenceManager will crash by design ?

created by Tim Coninx in JBoss Messaging - View the full discussion

I posted in another discussion about having to remove messages by hand from our oracle db. But now we found the problem behind this necessity.

 

The context is that we sometimes have to 'DELETE FROM JBM_MSG_REF' when messages still exist in a queue, because when a server tries to start the queue, he fails with:

java.sql.SQLException: Invalid column index

 

The reason behind this is as follows:

- in the persistence-service.xml (in our case the one for oracle), a SELECT query is defined as:

LOAD_UNPAGED_REFS=SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY FROM JBM_MSG_REF WHERE STATE = 'C' AND CHANNEL_ID = ? AND PAGE_ORD IS NULL ORDER BY ORD

- in the supported JDBCPersistenceManager in jboss-messaging (version 1_4_6_GA) the following code appears in the method loadFromStart(long, int)

 

982ps = conn.prepareStatement(getSQLStatement("LOAD_UNPAGED_REFS"));
983
984ps.setFetchSize(number);
985
986ps.setLong(1, channelID);
987
988rs = ps.executeQuery();
989
990List<ReferenceInfo> refs = new ArrayList<ReferenceInfo>();
991
992List<ReferenceInfo> refsToUpdate = new ArrayList<ReferenceInfo>();
993
994int count = 0;
995boolean inMemSwitch = false;
996boolean nonPageFlag = true;
997while (rs.next())
998{
999rs.getObject(4);
1000inMemSwitch = rs.wasNull();
1001if (nonPageFlag && (!inMemSwitch))
1002{
1003nonPageFlag = false;
1004}

 

I have no idea what the use of 'inMemSwitch' is (it will be ignored because nonPageFlag is always true), or how it is set. But the result of this is that when there are message entries in our queues from a previous run, the startup code for that queue WILL crash (4 > 3).

 

What am I supposed to do now ? I can't just upgrade because we're under support contract for this version.

 

Or am I missing something ?

 

Thanks in advance for any helpful replies !

Tim

Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community