[
https://issues.apache.org/jira/browse/AMQ-3860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13435785#comment-13435785
]
Benoit Olbrechts commented on AMQ-3860:
---------------------------------------
For those having the same issue:
You can use the DefaultJDBCAdapter by defining its data types for
strings/long/sequences/binary/..:
{code}
<persistenceAdapter>
<jdbcPersistenceAdapter dataDirectory="${activemq.base}/data"
dataSource="#informix-ds" createTablesOnStartup="false" >
<amq:adapter>
<amq:defaultJDBCAdapter>
<amq:statements>
<amq:statements
containerNameDataType="VARCHAR(150)"
stringIdDataType="VARCHAR(150)"
longDataType="INT8"
sequenceDataType="INT8"
binaryDataType="BYTE" />
</amq:statements>
</amq:defaultJDBCAdapter>
</amq:adapter>
</jdbcPersistenceAdapter>
</persistenceAdapter>
{code}
Good luck!
> doAddMessageReference missing setting priority into prepared statement
> therefore using wrong index for message itself
> ----------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-3860
> URL: https://issues.apache.org/jira/browse/AMQ-3860
> Project: ActiveMQ
> Issue Type: Bug
> Components: Message Store
> Affects Versions: 5.4.2, 5.5.0, 5.6.0
> Reporter: Mikhail Melamud
>
> Not sure in what cases ActiveMQDestination() is actually called, but
> getAddMessageStatement() returns statement with 7 params to set...
>
> public void doAddMessageReference(TransactionContext c, long sequence,
> MessageId messageID, ActiveMQDestination destination,
> long expirationTime, String messageRef) throws SQLException,
> IOException {
> PreparedStatement s = c.getAddMessageStatement();
> cleanupExclusiveLock.readLock().lock();
> try {
> if (s == null) {
> s =
> c.getConnection().prepareStatement(this.statements.getAddMessageStatement());
> if (this.batchStatments) {
> c.setAddMessageStatement(s);
> }
> }
> s.setLong(1, messageID.getBrokerSequenceId());
> s.setString(2, messageID.getProducerId().toString());
> s.setLong(3, messageID.getProducerSequenceId());
> s.setString(4, destination.getQualifiedName());
> s.setLong(5, expirationTime);
> s.setString(6, messageRef);
> if (this.batchStatments) {
> s.addBatch();
> } else if (s.executeUpdate() != 1) {
> throw new SQLException("Failed add a message");
> }
> } finally {
> cleanupExclusiveLock.readLock().unlock();
> if (!this.batchStatments) {
> s.close();
> }
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira