public void doInTransactionWithoutResult(TransactionStatus transactionStatus)
{
try
{
Date timestamp = new Date();
KeyHolder keyHolder = new GeneratedKeyHolder();
jdbcTemplate.update(
getEbMSMessagePreparedStatement(
timestamp,
message.getMessageHeader().getCPAId(),
message.getMessageHeader().getConversationId(),
message.getMessageOrder() == null ? null : message.getMessageOrder().getSequenceNumber().getValue().longValue(),
message.getMessageHeader().getMessageData().getMessageId(),
message.getMessageHeader().getMessageData().getRefToMessageId(),
message.getMessageHeader().getFrom().getRole(),
message.getMessageHeader().getTo().getRole(),
message.getMessageHeader().getService().getType(),
message.getMessageHeader().getService().getValue(),
message.getMessageHeader().getAction(),
message.getOriginal(),
XMLMessageBuilder.getInstance(SignatureType.class).handle(new ObjectFactory().createSignature(message.getSignature())),
XMLMessageBuilder.getInstance(MessageHeader.class).handle(message.getMessageHeader()),
XMLMessageBuilder.getInstance(SyncReply.class).handle(message.getSyncReply()),
XMLMessageBuilder.getInstance(MessageOrder.class).handle(message.getMessageOrder()),
XMLMessageBuilder.getInstance(AckRequested.class).handle(message.getAckRequested()),
XMLMessageBuilder.getInstance(Manifest.class).handle(message.getManifest()),
status
),
keyHolder
);
for (DataSource attachment : message.getAttachments())
{
simpleJdbcTemplate.update
(
"insert into ebms_attachment (" +
"ebms_message_id," +
"name," +
"content_type," +
"content" +
") values (?,?,?,?)",
keyHolder.getKey().longValue(),
attachment.getName() == null ? Constants.DEFAULT_FILENAME : attachment.getName(),
attachment.getContentType().split(";")[0].trim(),
IOUtils.toByteArray(attachment.getInputStream())
);
}
jdbcTemplate.update(
getEbMSMessagePreparedStatement(
timestamp,
acknowledgment.getMessageHeader().getCPAId(),
acknowledgment.getMessageHeader().getConversationId(),
acknowledgment.getMessageHeader().getMessageData().getMessageId(),
acknowledgment.getMessageHeader().getMessageData().getRefToMessageId(),
acknowledgment.getMessageHeader().getFrom().getRole(),
acknowledgment.getMessageHeader().getTo().getRole(),
acknowledgment.getMessageHeader().getService().getType(),
acknowledgment.getMessageHeader().getService().getValue(),
acknowledgment.getMessageHeader().getAction(),
XMLMessageBuilder.getInstance(MessageHeader.class).handle(acknowledgment.getMessageHeader()),
XMLMessageBuilder.getInstance(Acknowledgment.class).handle(acknowledgment.getAcknowledgment())
),
keyHolder
);
simpleJdbcTemplate.update
(
"insert into ebms_send_event (" +
"ebms_message_id," +
"time" +
") values (?,?)",
keyHolder.getKey().longValue(),
//String.format(getDateFormat(),sendTime)
sendEvent.getTime()
);
}
catch (Exception e)