activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yuelei <ccyue...@163.com>
Subject Is this a bug in DefaultJDBCAdapter.java?
Date Tue, 04 Jul 2006 15:31:16 GMT

Is this a bug in the file DefaultJDBCAdapter.java?

Is this line right?
PreparedStatement s = c.getAddMessageStatement();
in the follow method:

    public void doSetLastAck(TransactionContext c, ActiveMQDestination
destination, String clientId, String subscriptionName, long seq) throws
SQLException, IOException {
        
        PreparedStatement s = c.getAddMessageStatement();
        try {
            if( s == null ) {
                s =
c.getConnection().prepareStatement(statements.getUpdateLastAckOfDurableSubStatement());
                if( batchStatments ) {
                    c.setUpdateLastAckStatement(s);
                }
            }
            
            s.setLong(1, seq);
            s.setString(2, destination.getQualifiedName());
            s.setString(3, clientId);
            s.setString(4, subscriptionName);

            if( batchStatments ) {
                s.addBatch();
            } else if ( s.executeUpdate() != 1 ) {
                throw new SQLException("Failed add a message");
            }
        } finally {
            if( !batchStatments ) {
                s.close();
            }
        }

    }

Anyone show me the answer?
-- 
View this message in context: http://www.nabble.com/Is-this-a-bug-in-DefaultJDBCAdapter.java--tf1890445.html#a5168977
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message