[jboss-user] [JBoss Messaging] - problem executing jdbc statement via mdb

Jose Miguel Loor do-not-reply at jboss.com
Mon May 24 03:10:35 EDT 2010

Jose Miguel Loor [http://community.jboss.org/people/jmiguel77] created the discussion

"problem executing jdbc statement via mdb"

To view the discussion, visit: http://community.jboss.org/message/544431#544431


i have an odd issue trying to execute a callable  statement via a MessageDrivenBean. the scenario is like this:

i  have @Stateles session bean that produces the message

 public class MensajesServiceImpl implements MensajesService,
         MensajesServiceRemote {

    @Resource(mappedName = "java:/JmsXA")
     private ConnectionFactory connectionFactory;

    @Resource(mappedName = "queue/balanceComprobacionQueue")
     private Queue balanceComprobacionQueue;

    public void llamarEjecucionArbolCuenta(final Integer periodo)
             throws JMSException {
         QueueConnectionFactory qcf = (QueueConnectionFactory)  connectionFactory;
         QueueConnection queueConnection = qcf.createQueueConnection();
         QueueSession queueSession =  queueConnection.createQueueSession(false,
         QueueSender queueSender = queueSession
         ObjectMessage message = queueSession.createObjectMessage();
         message.setIntProperty(Constantes.PERIODO_MESSAGE_PROPERTY,  periodo);

the message is received by the MDB

@MessageDriven(activationConfig  = {
         @ActivationConfigProperty(propertyName = "destinationType",  propertyValue = "javax.jms.Queue"),
         @ActivationConfigProperty(propertyName = "destination",  propertyValue = "queue/balanceComprobacionQueue") })
 public class BalanceComprobacionMessageDrivenBean implements  MessageListener {

     private BalanceComprobacionService balanceComprobacionService;

     public void onMessage(final Message message) {
         try {
             if (message instanceof ObjectMessage) {
                 ObjectMessage periodoMessage = (ObjectMessage) message;
                 Integer periodo = periodoMessage
         } catch (JMSException e) {
         } catch (EjecucionFallidaException e) {



as you can see, in the MDB i am  injecting another stateless session bean (BalanceComprobacionService)  and calling a method registered in that session bean; the method i am  executing is this

 public class BalanceComprobacionDaoImpl implements  BalanceComprobacionDao {

    @Resource(mappedName = "java:/myDataSource")
     private DataSource dataSource;

     public void ejecutarArbolCuentas(final Integer periodo)
             throws EjecucionFallidaException {
         Connection connection = null;
         try {
             String sql = "{ call arbol_cuenta(?) }";
             connection = dataSource.getConnection();
             CallableStatement statement = connection.prepareCall(sql);
             statement.setInt(1, periodo);
         } catch (SQLException e) {
             throw new EjecucionFallidaException(e);
         } finally {
             try {
             } catch (SQLException e) {
                 throw new EjecucionFallidaException(e);

everything works fine, until the  statement.execute(); at this point, the execution just stops; it doesn't  give any error, exception, nor in the jboss server or the database, it  just stops right there

i am using jboss 4.2.3.GA with  jdk 1.6_0.15; the database is postgresql 8.3

i don't  think the problem is related with the database or the function i am  calling, because if i test the BalanceComprobacionDaoImpl by itself, it  works ok, it's just when i test the whole process that it stops at the  callable statement execution

please help, thanks


Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100524/854375fb/attachment-0001.html 

More information about the jboss-user mailing list