Title: RE: [JBoss-dev] Backend session information - Tx - Data distribut ion

Hi,

I don't think JMS is an option, since the distribution mechanism requires changes to be recorded in exact order of appearance.

Also, changes which have to be distributed are stored in a set of tables in database. This should also be done within the running transaction. If the distribution engine fails to write to database, also the original insert/update/delete is rolled back.

There is no way to lookup the current Transaction and re-use that instance to perform all DB actions?

The ThreadInfo instance is only visible in the TxManager class?

Last question :o)
There's no way to be notified or to listen when a new transaction is created and when a transaction is about to commit?

Thanks in advance :o)
Wonne



-----Original Message-----
From: David Jencks
To: [EMAIL PROTECTED]
Sent: 6/6/02 7:01 PM
Subject: Re: [JBoss-dev] Backend session information - Tx - Data distribut ion

I must be asleep.  The jms + xa scheme is the way to go.

david jencks

On 2002.06.06 12:38:35 -0400 David Jencks wrote:
> What I suggested would let you notify after transaction completion
> without
> modifying your ejbs.  This is apparently not what you want.  I
therefore
> suggest you write another layer of session beans around everything you
> want
> notifications from.  The session bean will generate an abstract
> transaction
> id, added to every outgoing method call. Upon successful return, the
> session bean will do the notifications using the transaction id as key
to
> find the correct info.  I don't see the point of your mbean scheme,
nor
> how
> it would work.
>
> david jencks
>
> On 2002.06.06 11:22:38 -0400 "Keysers, Wonne" wrote:
> > 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
> > >

Reply via email to