geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher James Blythe (JIRA)" <...@geronimo.apache.org>
Subject [jira] Commented: (DAYTRADER-22) Set publichQuotePriceChange to true in ejb-jar.xml so that MDBs get accessed during Daytrader scenario runs
Date Tue, 14 Nov 2006 17:38:37 GMT
    [ http://issues.apache.org/jira/browse/DAYTRADER-22?page=comments#action_12449715 ] 
            
Christopher James Blythe commented on DAYTRADER-22:
---------------------------------------------------

All...

Since my involvement with Daytrader (and Trade), we've never been all that concerned with
the Async 1-phase mode. Here is the lay of the land to my understanding...

Sync mode
 - Uses JMS topics and TradeTopicMDB to publish changes to the quote prices
 - There is flag in the DDs to disable this but it doesn't seem to apply to direct mode (only
EJB mode)
Async 2-phase mode
 - This mode uses a JMS queue and the TradeBroker to handle order processing
 - Specifically, the buy and sell operations call a queueOrder method to place a message on
the queue
 - The queueOrder is part of an XA transaction because two resource managers (JMS and database)
are involved to create the order in the databse and place a message on the queue
- The MDB starts a new transaction when the message is read from the queue. The MDB then executes
the completeOrder method which updates the order in the database inside the original MDB transaction
context
Async 1-phase mode
 - Does the same as above, but does not involve an UserTransaction to provide XA
 - Since the MDB is container-managed, TradeEJB is used to complete the order and create a
new transaction (avoiding XA)

My guess is that the Async 1-phase mode was added to messure the overhead associated with
handling the XA transaction. 

I think Andrew Spyker was partly responsible for adding this... so, let me see if I can track
him down to get more details. 

Regardless, I have never found that much value in Async 1-phase mode. If you are using two
different resources as part of a logical transaction, you should always use XA to ensure proper
rollback handling. Honestly, I see very little need to keep it around... However, there might
be some possiblities I have not considered. Removing this option (and associated dependency)
would also make it easier to decouple the app as suggested in Daytrader-23. 

I like the idea of splitting up the modes by category and doing a little renaming to make
them more descriptive.

Persistence Run-time Modes (one has to be selected)
1) Direct (or JDBC)
2) Stateless Session Bean to Direct
3) Full EJB (Stateless Session Bean to Entity Beans)

JMS Support Enablement (any can be selected)
- Publish Quote Updates (Publish quote price changes to a JMS topic)  
- Process Buy/Sell Orders using XA (Asychronously process buy/sell orders by placing them
on a JMS queue. An MDB is then responsible for reading a message form the queue and completing
the order)

Thoughts?

> Set publichQuotePriceChange to true in ejb-jar.xml so that MDBs get accessed during Daytrader
scenario runs
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DAYTRADER-22
>                 URL: http://issues.apache.org/jira/browse/DAYTRADER-22
>             Project: DayTrader
>          Issue Type: Bug
>          Components: EJB Tier
>    Affects Versions: 1.2
>            Reporter: Piyush Agarwal
>         Assigned To: Matt Hogstrom
>             Fix For: 1.2
>
>         Attachments: Daytrader-22.patch
>
>
> Currently the publishQuotePriceChange is set to False in the ejb-jar.xml and this causes
the TradeStreamerMDB to NOT be accessed during the Daytrader trading runs. The TradeStreamerMDB
listens to the JMS messages and invokes the logging code to log the debug and trace messages
during the runs. Updating the flag to true enables this functionality.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message