I am working on a design to revamp a system that i wrote about 8 years
ago when i learned Java because the outsource crew we originally hired
to write it pissed me off for the last time.  Im having a problem in
the design that im sure is easy to fix but the fix eludes me.

Its a middleware application.  basically its an HTTP servlet that
accepts an XML document from a client and process it.  its deployed as
a war file on jboss 5.1

Now, when the system gets a transaction, the first thing it does is go
to a router that pulls the beginning tag out of the xml to figure out
what the transaction is and routes it to the appropriate manager.
now, currently the first thing that happens when it reaches the
manager is its written to the database, then as the transaction
progresses that record is updated.  you can see the core of my problem
already and the main reason im redesigning it.  but i have an
interesting problem.  each transaction creates several audit log
entries, those logs are linked to the original record by ID.  but if i
havn't written the original transaction yet, i have no ID to link the
audits to.

SO, basically what i need is a transaction level session space for
lack of a better term for it something that is created when the
transaction starts that i can simply insert my audit objects into
during the transaction and when the transaction is finished, i pass to
a method that writes the transaction data and then goes to that
session info and writes the audit log entries.  i was looking at JTA
to do this but i think thats a bit overkill for my needs.  i was
thinking about doing this as a simple singleton but im not sure if
that singleton would cross transactions, which would be very bad.

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to