Re: [JBoss-dev] Backend session information - Tx - Data distribution
I'm still a little unclear about what you want. I think it is to be notified right after every transaction commits. Unfortuneately there is no way to register a listener with the tx manager for all transactions. I think the simplest ways to do this are: if you use only cmt, no bmt, modify the tx interceptor to call something after (successful) commit If you use bmt as well, modify the tx manager to notify you. david jencks On 2002.06.06 02:29:52 -0400 Keysers, Wonne wrote: Hi, I already asked this question on the user-list, but got not a single answer. Could somebody help me please? I want to create something which keeps track of some backend session information, for data distribution purposes to offline clients. In that session-info are things like the user logged in, data sharing information (some distribution of data is use case specific, most are DB based though), etc. It is important that data is distributed only when the container transaction commits. What's the best way to do this? Create an MBean, just like the TxManager works, with a ThreadLocal variable? What will happen with the transaction information of that current thread (ThreadInfo inside the TxManager) in this case? Also, is it possible to lookup the current transaction or transactionID or info or transaction information? Thanks in advance for any tips! Wonne !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=US-ASCII META NAME=Generator CONTENT=MS Exchange Server version 5.5.2654.19 TITLEBackend session information - Tx - Data distribution/TITLE /HEAD BODY PFONT SIZE=2Hi, /FONT /P PFONT SIZE=2I already asked this question on the user-list, but got not a single answer. Could somebody help me please?/FONT /P PFONT SIZE=2I want to create something which keeps track of some backend session information, for data distribution purposes to offline clients./FONT/P PFONT SIZE=2In that session-info are things like the user logged in, data sharing information (some distribution of data is use case specific, most are DB based though), etc.nbsp; It is important that data is distributed only when the container transaction commits./FONT/P PFONT SIZE=2What's the best way to do this?/FONT /P PFONT SIZE=2Create an MBean, just like the TxManager works, with a ThreadLocal variable? /FONT BRFONT SIZE=2What will happen with the transaction information of that current thread (ThreadInfo inside the TxManager) in this case? /FONT/P PFONT SIZE=2Also, is it possible to lookup the current transaction or transactionID or info or transaction information?/FONT /P BR PFONT SIZE=2Thanks in advance for any tips!/FONT /P PFONT SIZE=2Wonne/FONT /P /BODY /HTML ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
RE: [JBoss-dev] Backend session information - Tx - Data distribution
Title: RE: [JBoss-dev] Backend session information - Tx - Data distribution Thanks for replying. What I want is the following: During a CMT, all changes are logged to the distribution engine. When the transaction is about to commit, the dist. engine tries to distribute the right changes. (basically this is a copy of the new values in an export table) The engine not only has to use the running transaction (I could use a statefull session bean), but also has to save the password authenticated (JAAS) user(id) and the distribution information (dependant of the context) in the export table. I would like to keep my hands of JBoss' source code. I was thinking of making an MBean for the distribution engine, which is able to reuse the Tx associated with the current Thread and which allows EJB's (afterBegin()?) and other clients to register the required context information as soon as a new Tx is started. In other words, Transaction, User and other context information must be linked to the same thread just like the TxManager does with a Tx and TimeOut? (Or have I interpreted this in the wrong way?) Is all that possible? Oh yes, when I create a new ThreadLocal attribute in my new MBean, will the ThreadLocal attribute within the TxManager be overwritten or are these only known internally? Thanks a lot! Wonne -Original Message- From: David Jencks To: [EMAIL PROTECTED] Sent: 6/6/02 3:20 PM Subject: Re: [JBoss-dev] Backend session information - Tx - Data distribution I'm still a little unclear about what you want. I think it is to be notified right after every transaction commits. Unfortuneately there is no way to register a listener with the tx manager for all transactions. I think the simplest ways to do this are: if you use only cmt, no bmt, modify the tx interceptor to call something after (successful) commit If you use bmt as well, modify the tx manager to notify you. david jencks On 2002.06.06 02:29:52 -0400 Keysers, Wonne wrote: Hi, I already asked this question on the user-list, but got not a single answer. Could somebody help me please? I want to create something which keeps track of some backend session information, for data distribution purposes to offline clients. In that session-info are things like the user logged in, data sharing information (some distribution of data is use case specific, most are DB based though), etc. It is important that data is distributed only when the container transaction commits. What's the best way to do this? Create an MBean, just like the TxManager works, with a ThreadLocal variable? What will happen with the transaction information of that current thread (ThreadInfo inside the TxManager) in this case? Also, is it possible to lookup the current transaction or transactionID or info or transaction information? Thanks in advance for any tips! Wonne !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=US-ASCII META NAME=Generator CONTENT=MS Exchange Server version 5.5.2654.19 TITLEBackend session information - Tx - Data distribution/TITLE /HEAD BODY PFONT SIZE=2Hi, /FONT /P PFONT SIZE=2I already asked this question on the user-list, but got not a single answer. Could somebody help me please?/FONT /P PFONT SIZE=2I want to create something which keeps track of some backend session information, for data distribution purposes to offline clients./FONT/P PFONT SIZE=2In that session-info are things like the user logged in, data sharing information (some distribution of data is use case specific, most are DB based though), etc.nbsp; It is important that data is distributed only when the container transaction commits./FONT/P PFONT SIZE=2What's the best way to do this?/FONT /P PFONT SIZE=2Create an MBean, just like the TxManager works, with a ThreadLocal variable? /FONT BRFONT SIZE=2What will happen with the transaction information of that current thread (ThreadInfo inside the TxManager) in this case? /FONT/P PFONT SIZE=2Also, is it possible to lookup the current transaction or transactionID or info or transaction information?/FONT /P BR PFONT SIZE=2Thanks in advance for any tips!/FONT /P PFONT SIZE=2Wonne/FONT /P /BODY /HTML ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
Re: [JBoss-dev] Backend session information - Tx - Data distribution
You could also you JMS with XA - send messages out containing whatever you need to track. This will be sent iff the transaction commits. You can then write an MDB (or any other listener) to take the messages and do whatever you want with them. You actually could (maybe) make the offline clients registered listeners on the topic(s) - that way when they connect they should get all of the messages sent since their last connect. JMS experts, correct me if I'm out of line, here. -danch David Jencks wrote: I'm still a little unclear about what you want. I think it is to be notified right after every transaction commits. Unfortuneately there is no way to register a listener with the tx manager for all transactions. I think the simplest ways to do this are: if you use only cmt, no bmt, modify the tx interceptor to call something after (successful) commit If you use bmt as well, modify the tx manager to notify you. david jencks On 2002.06.06 02:29:52 -0400 Keysers, Wonne wrote: Hi, I already asked this question on the user-list, but got not a single answer. Could somebody help me please? I want to create something which keeps track of some backend session information, for data distribution purposes to offline clients. In that session-info are things like the user logged in, data sharing information (some distribution of data is use case specific, most are DB based though), etc. It is important that data is distributed only when the container transaction commits. What's the best way to do this? Create an MBean, just like the TxManager works, with a ThreadLocal variable? What will happen with the transaction information of that current thread (ThreadInfo inside the TxManager) in this case? Also, is it possible to lookup the current transaction or transactionID or info or transaction information? Thanks in advance for any tips! Wonne !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=US-ASCII META NAME=Generator CONTENT=MS Exchange Server version 5.5.2654.19 TITLEBackend session information - Tx - Data distribution/TITLE /HEAD BODY PFONT SIZE=2Hi, /FONT /P PFONT SIZE=2I already asked this question on the user-list, but got not a single answer. Could somebody help me please?/FONT /P PFONT SIZE=2I want to create something which keeps track of some backend session information, for data distribution purposes to offline clients./FONT/P PFONT SIZE=2In that session-info are things like the user logged in, data sharing information (some distribution of data is use case specific, most are DB based though), etc.nbsp; It is important that data is distributed only when the container transaction commits./FONT/P PFONT SIZE=2What's the best way to do this?/FONT /P PFONT SIZE=2Create an MBean, just like the TxManager works, with a ThreadLocal variable? /FONT BRFONT SIZE=2What will happen with the transaction information of that current thread (ThreadInfo inside the TxManager) in this case? /FONT/P PFONT SIZE=2Also, is it possible to lookup the current transaction or transactionID or info or transaction information?/FONT /P BR PFONT SIZE=2Thanks in advance for any tips!/FONT /P PFONT SIZE=2Wonne/FONT /P /BODY /HTML ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development