Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

Applies To: JDK 1.5 / 1.6, CE 7.3/ 7.4

Author(s):      Biplab Ray

Company:      Tata Consultancy Services

Created on:    12th February 2015

Author Bio:

Biplab Ray is working for Tata Consultancy Services as Assistant Consultant and development of SAP EP, composite applications using CAF, BPM, BRM, WebDynpro for Java. He also works in technologies like Java/J2EE and has depth understanding on eSOA, Webservice, Enterprise Service, XML.


In many case we were facing issue to passing the message via JMS queue of Application server.

In some situation at a single point of time more than 10,000 messages was passing via JMS queue of Application Server java, if due to some error one of the message was not able to pass from the queue then rest of the message would stuck in the queue.

If we restart the application server, even though queue would not getclear, and application server would try to post rest of the message again and would reach to the same situation.

To overcome the situation we have to update the message status from “DLNG” to “FAIL”.

Implementation :

  1. Create one EJB.
  2. Write one business method.
  3. And expose the ejb as web service.

In the class below imports are required :

import java.sql.Connection;

import java.sql.PreparedStatement;

import java.sql.SQLException;

import javax.annotation.Resource;

import javax.sql.DataSource;

For back end connectivity we required Data Source.

Please declare Data Source as below.

@Resource(mappedName = "SAP/CAF_RT")

DataSource dataSource;

Business method implementation as below

@javax.ejb.TransactionAttribute (javax.ejb.TransactionAttributeType.REQUIRES_NEW)

      public void clear() {

                       try {

                              Connection connection = dataSource.getConnection();

                              PreparedStatement preparedStatement = connection.prepareStatement


                              preparedStatement.setString(1, "FAIL");

                              preparedStatement.setString(2, "DLNG");




                  } catch (SQLException e) {

                              // TODO Auto-generated catch block




Labels in this area