public void testSimpleWithOneProducerTransacted() throws Exception
| {
| JBossConnection conn =
(JBossConnection)this.factoryServer1.createConnection();
| Session session = conn.createSession(true,Session.AUTO_ACKNOWLEDGE);
| Destination destination =
(Destination)getCtx1().lookup("queue/testQueue");
| MessageProducer producer = session.createProducer(destination);
|
| Message message = session.createTextMessage("Hello Before");
| producer.send(message);
|
| ClientConnectionDelegate delegate =
(ClientConnectionDelegate)conn.getDelegate();
| ConnectionState state = (ConnectionState)delegate.getState();
|
| JBossConnection conn2 =
(JBossConnection)this.factoryServer2.createConnection();
| conn.getDelegate().failOver(conn2.getDelegate());
|
| message = session.createTextMessage("Hello After");
| producer.send(message);
| session.commit();
| }
|
Just completing my last post, if I used the same testcase in a transacted scenario (with
pending transactions) I would get this exception:
| org.jboss.aop.NotFoundInDispatcherException: Object with oid: 47 was not found in the
Dispatcher
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:85)
| at
org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:127)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:1008)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:857)
| at
org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:454)
| at
org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:541)
| at
org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:261)
| at
org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:172)
| at org.jboss.remoting.Client.invoke(Client.java:589)
| at org.jboss.remoting.Client.invoke(Client.java:581)
| at
org.jboss.jms.client.delegate.DelegateSupport.invoke(DelegateSupport.java:111)
| at
org.jboss.jms.client.delegate.ClientConnectionDelegate$sendTransaction_N4986868250254447300.invokeNext(ClientConnectionDelegate$sendTransaction_N4986868250254447300.java)
|
I guess I should throw an exception if there are pending transactions and a failover
happened. I think that would be the expected signature. (Anyone disagrees?)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977688#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...