[jboss-user] [JBoss Messaging Users] - Re: Possible transaction scopes for asynchronous reception?

2009-09-04 Thread ataylor
I'm not sure i understand your question. when you say 'consumption of the same 
set of messages' do you mean from a topic. If so the each consumer can consumer 
the messages within its own transaction. The transaction covers the delivery of 
the messages not the message itself.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253576#4253576

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253576
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging Users] - Re: Possible transaction scopes for asynchronous reception?

2009-09-04 Thread gaohoward
in JMS, the producer and consumer are separate. So you are free to define a 
transaction boundary for the messages regardless the producer side.  don't 
quite understand your second question, can you explain it a bit more?


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253590#4253590

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253590
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging Users] - Re: Possible transaction scopes for asynchronous reception?

2009-09-04 Thread chtimi2
"gaohoward" wrote : in JMS, the producer and consumer are separate. So you are 
free to define a transaction boundary for the messages regardless the producer 
side.  
  | 
Hopefully my answer to ataylor makes what i want to do a bit clearer.
I know it is possible to define the transaction boundary consumer-side (you 
need to use BMT in you MDB).
But since in my example the 2 onMessage executions would happen in a different 
thread, wouldn't it be impossible for them to happen in the same transaction?

"gaohoward" wrote : 
  | don't quite understand your second question, can you explain it a bit more?
  | 
For instance can 2 onMessages (different threads) execute in a single 
transaction? 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253605#4253605

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253605
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging Users] - Re: Possible transaction scopes for asynchronous reception?

2009-09-04 Thread chtimi2
Sorry my question wasn't very clear.
I know that it isn't possible to produce and consume a message in the same 
transaction.

What i want to do is this:
If N messages have been produced in a single transaction T_prod, i want them to 
be consumed in a single transaction T_cons.
T_prod and T_cons don't have to be the same, i know that's not possible.

"ataylor" wrote : I'm not sure i understand your question. when you say 
'consumption of the same set of messages' do you mean from a topic. 
  | If so the each consumer can consumer the messages within its own 
transaction. The transaction covers the delivery of the messages not the 
message itself.

Yes, i'm talking about a topic.
Let's say that the producer posts 2 messages, in a transaction (let's call it 
T_prod).

Let's say the consumer is a MDB: with Container Managed Transaction, each 
onMessage will execute in a new transaction, independant from T_prod.

What i'm wondering is whether it's possible, by using Bean Managed Transaction 
in the MDB, to get the 2 onMessage calls to execute within a single 
transaction. 

I'm thinking of a pattern like this:
-Producer side: put the T_prod transaction id in the message header
-Consumer side: read the transaction id to determine if the message is the 
first to be recieved from T_prod, manually start and commit



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253602#4253602

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253602
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging Users] - Re: Possible transaction scopes for asynchronous reception?

2009-09-04 Thread ataylor
Ok, i see what your asking, but it seems like a strange thing to try and 
acheive. Maybe your app architecture needs a rethink?

Any way with BMT its the container that creates the UserTransaction you have 
access to, you only commit or rollback, so each MDB instance would have its own 
transation. You could create your own tx but that wouldnt involve the delivery 
of the message which is i guess what you want. I would rethink what you want.  
p.s. all this is more to do with the App server than messaging per se, so maybe 
they would be ablt to help you more, but in trusth i would think of a different 
solution

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253608#4253608

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253608
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging Users] - Re: Possible transaction scopes for asynchronous reception?

2009-09-11 Thread chtimi2
Any idea? I get the feeling that the real problem is an incompatibility between 
asynchronicity and the propagation of the transaction context but it is an 
impossibility or something i'm unfamiliar with? And is this incompatibility 
specific to JMS or more general?

After all the transaction context is propagated to a different thread (from the 
client thread to the server thread) by rmi during a remote transactional 
invocation, so it doesn't have to be strictly thread-local.

On the other hand even in the EJB 3.1 spec, it is mentioned that for the new 
@Asynchronous methods, the transaction context will not be propagated from the 
caller to the callee.


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4254653#4254653

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4254653
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Messaging Users] - Re: Possible transaction scopes for asynchronous reception?

2009-09-25 Thread chtimi2
The only solution i can think of is intercepting message production, to 
aggregate the messages produced within a transaction into a single wrapper 
message. 
This way the consumption scope necessarily spans the same messages as the 
production scope.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257055#4257055

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257055
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user