[
https://issues.apache.org/jira/browse/QPID-8257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16676627#comment-16676627
]
Alex Rudyy edited comment on QPID-8257 at 11/6/18 11:14 AM:
------------------------------------------------------------
[~rgodfrey], We actually insert content row into jdbc store when content is
null or empty (see,
{{org.apache.qpid.server.store.jdbc.AbstractJDBCMessageStore.StoredJDBCMessage#store}})
{code}
synchronized void store(final Connection conn) throws SQLException
{
if (!stored())
{
AbstractJDBCMessageStore.this.storeMetaData(conn, _messageId,
_messageDataRef.getMetaData());
AbstractJDBCMessageStore.this.addContent(conn, _messageId,
_messageDataRef.getData() == null
?
QpidByteBuffer.emptyQpidByteBuffer()
:
_messageDataRef.getData());
getLogger().debug("Storing message {} to store", _messageId);
_messageDataRef.setSoft();
}
}
{code}
I think we can change the code to stop insert content record for null or empty
content. Though, we would need to stop treating absence of content record as an
exception (see
{{org.apache.qpid.server.store.jdbc.AbstractJDBCMessageStore#getAllContent}}).
was (Author: alex.rufous):
[~rgodfrey], We actually insert content row into jdbc storte when content is
null or empty (see,
{{org.apache.qpid.server.store.jdbc.AbstractJDBCMessageStore.StoredJDBCMessage#store}})
{code}
synchronized void store(final Connection conn) throws SQLException
{
if (!stored())
{
AbstractJDBCMessageStore.this.storeMetaData(conn, _messageId,
_messageDataRef.getMetaData());
AbstractJDBCMessageStore.this.addContent(conn, _messageId,
_messageDataRef.getData() == null
?
QpidByteBuffer.emptyQpidByteBuffer()
:
_messageDataRef.getData());
getLogger().debug("Storing message {} to store", _messageId);
_messageDataRef.setSoft();
}
}
{code}
I think we can change the code to stop insert content record for null or empty
content. Though, we would need to stop treating absence of content record as an
exception (see
{{org.apache.qpid.server.store.jdbc.AbstractJDBCMessageStore#getAllContent}}).
> Sybase message store not supporting empty messages
> --------------------------------------------------
>
> Key: QPID-8257
> URL: https://issues.apache.org/jira/browse/QPID-8257
> Project: Qpid
> Issue Type: Bug
> Components: Broker-J
> Affects Versions: qpid-java-broker-7.0.3
> Reporter: Olivier VERMEULEN
> Priority: Major
>
> Unlike other databases Sybase default nullability for a column is "NOT NULL".
> And since we don't specify anything when creating the QPID_MESSAGE_CONTENT
> table, the "content" column defaults to "NOT NULL".
> So when we send an empty message, this constraint is broken and we receive a
> SybSQLException...
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]