DayTrader 7 uses five JPA 2.1 entities mapped to relational database tables within theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/WASdev/sample.daytrader7/llms.txt
Use this file to discover all available pages before exploring further.
daytrader persistence unit (configured in daytrader-ee7-ejb/src/main/resources/META-INF/persistence.xml, using the jdbc/TradeDataSource JTA data source). Every table includes an optLock integer column in the DDL schema; this column is present for schema compatibility but is not mapped to a @Version field in the current entity classes. The DDL for all tables is provided in daytrader-ee7-ejb/src/main/resources/META-INF/daytrader.sql. Primary keys for AccountDataBean, HoldingDataBean, and OrderDataBean are generated using a shared table-based generator (KEYGENEJB), avoiding database-sequence contention.
The JPA shared second-level cache is explicitly disabled (
<shared-cache-mode>NONE</shared-cache-mode>) in persistence.xml so that every read goes to the database, producing a more representative benchmark workload.Entity: AccountDataBean
Table:accountejbJava class:
com.ibm.websphere.samples.daytrader.entities.AccountDataBean
AccountDataBean represents a customer’s brokerage account. It is the root aggregate for orders and holdings. The profile_userid column is a foreign key to accountprofileejb, linking each account to its profile. Login and logout activity increments loginCount and logoutCount directly on the entity, making these counters useful benchmark metrics.
| Column | Type | Notes |
|---|---|---|
ACCOUNTID | integer | Primary key; generated via KEYGENEJB table |
LOGINCOUNT | integer NOT NULL | Incremented on every successful login |
LOGOUTCOUNT | integer NOT NULL | Incremented on every logout |
LASTLOGIN | timestamp | Updated to NOW() on each login |
CREATIONDATE | timestamp | Set at account registration |
BALANCE | decimal(10,2) | Current cash balance; debited on buy, credited on sell |
OPENBALANCE | decimal(10,2) | Initial deposit balance; never modified after registration |
PROFILE_USERID | varchar(250) | FK → accountprofileejb.userid |
optLock | integer | Schema column (not mapped to a @Version field in the entity) |
@OneToOne(lazy) →AccountProfileDataBeanviaPROFILE_USERID@OneToMany(lazy, mapped byaccount) →Collection<OrderDataBean>@OneToMany(lazy, mapped byaccount) →Collection<HoldingDataBean>
Entity: AccountProfileDataBean
Table:accountprofileejbJava class:
com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean
AccountProfileDataBean stores the user’s identifying and contact information. The userid field is both the natural primary key and the lookup key used throughout the application (e.g., entityManager.find(AccountProfileDataBean.class, userID)). Passwords are stored in plain text as this is a benchmark application, not a production system.
| Column | Type | Notes |
|---|---|---|
USERID | varchar(250) NOT NULL | Primary key; used as the application-level user identity |
PASSWD | varchar(250) | Password (plain text; benchmark only) |
FULLNAME | varchar(250) | Customer’s full name |
ADDRESS | varchar(250) | Street address |
EMAIL | varchar(250) | Email address |
CREDITCARD | varchar(250) | Credit card number used during registration |
optLock | integer | Schema column (not mapped to a @Version field in the entity) |
@OneToOne(lazy, inverse side, mapped byprofile) →AccountDataBean
Entity: QuoteDataBean
Table:quoteejbJava class:
com.ibm.websphere.samples.daytrader.entities.QuoteDataBean
QuoteDataBean represents a publicly traded stock. The symbol (e.g., "s:0" through "s:9999") is the natural primary key. After every buy or sell, TradeSLSBBean.updateQuotePriceVolume() issues a SELECT ... FOR UPDATE (via the named native query quoteejb.quoteForUpdate) and updates price, change1, high, low, and volume atomically. These updates are then published to TradeStreamerTopic for real-time WebSocket delivery.
| Column | Type | Notes |
|---|---|---|
SYMBOL | varchar(250) NOT NULL | Primary key; format "s:N" where N is 0–9999 |
COMPANYNAME | varchar(250) | Display name of the company |
VOLUME | double NOT NULL | Cumulative shares traded; incremented on each buy/sell |
PRICE | decimal(10,2) | Current market price; updated on each trade |
OPEN1 | decimal(10,2) | Price at market open; used to compute change1 |
LOW | decimal(10,2) | Intraday low |
HIGH | decimal(10,2) | Intraday high |
CHANGE1 | double NOT NULL | price − open1; updated on each trade |
optLock | integer | Schema column (not mapped to a @Version field in the entity) |
Referenced (as the
quote side) by @ManyToOne from HoldingDataBean and OrderDataBean. No back-reference is stored in QuoteDataBean itself.
Entity: HoldingDataBean
Table:holdingejbJava class:
com.ibm.websphere.samples.daytrader.entities.HoldingDataBean
HoldingDataBean represents a position in a stock that a customer currently owns. A holding is created by TradeSLSBBean.completeOrder() when a buy order is completed, and is removed (entityManager.remove(holding)) when a sell order is completed. Setting purchaseDate to Timestamp(0) marks a holding as “in-flight” (pending sale).
| Column | Type | Notes |
|---|---|---|
HOLDINGID | integer NOT NULL | Primary key; generated via KEYGENEJB table |
QUANTITY | double NOT NULL | Number of shares held |
PURCHASEPRICE | decimal(10,2) | Price per share at time of purchase |
PURCHASEDATE | timestamp | Date/time of purchase; set to Timestamp(0) when inflight for sale |
ACCOUNT_ACCOUNTID | integer | FK → accountejb.accountid |
QUOTE_SYMBOL | varchar(250) | FK → quoteejb.symbol |
optLock | integer | Schema column (not mapped to a @Version field in the entity) |
@ManyToOne(lazy) →AccountDataBeanviaACCOUNT_ACCOUNTID@ManyToOne(eager) →QuoteDataBeanviaQUOTE_SYMBOL
Entity: OrderDataBean
Table:orderejbJava class:
com.ibm.websphere.samples.daytrader.entities.OrderDataBean
OrderDataBean is the central transaction record. Every buy or sell creates an order with status "open". The order progresses through "processing" → "closed" (set by completeOrder) and then to "completed" (set by getClosedOrders when the user views their order history). Long-run benchmarks delete completed orders to prevent unbounded table growth. The entity declares a rich set of @NamedQuery definitions used by the JPQL-based query paths.
| Column | Type | Notes |
|---|---|---|
ORDERID | integer NOT NULL | Primary key; generated via KEYGENEJB table |
ORDERTYPE | varchar(250) | "buy" or "sell" |
ORDERSTATUS | varchar(250) | "open", "processing", "closed", "completed", or "cancelled" |
OPENDATE | timestamp | When the order was submitted |
COMPLETIONDATE | timestamp | When completeOrder ran; NULL until completion |
QUANTITY | double NOT NULL | Number of shares in the order |
PRICE | decimal(10,2) | Execution price (quote price at time of order creation) |
ORDERFEE | decimal(10,2) | Brokerage commission fee |
ACCOUNT_ACCOUNTID | integer | FK → accountejb.accountid |
QUOTE_SYMBOL | varchar(250) | FK → quoteejb.symbol |
HOLDING_HOLDINGID | integer | FK → holdingejb.holdingid; NULL for open orders |
optLock | integer | Schema column (not mapped to a @Version field in the entity) |
@ManyToOne(lazy) →AccountDataBeanviaACCOUNT_ACCOUNTID@ManyToOne(eager) →QuoteDataBeanviaQUOTE_SYMBOL@OneToOne(lazy) →HoldingDataBeanviaHOLDING_HOLDINGID
Entity-Relationship Summary
Scale Parameters
DayTrader 7 is pre-populated at benchmark time according to three constants defined inTradeConfig:
| Parameter | Default | Meaning |
|---|---|---|
MAX_USERS | 15,000 | Number of user accounts (uid:0 through uid:14999) pre-seeded in accountejb and accountprofileejb |
MAX_QUOTES | 10,000 | Number of stock symbols (s:0 through s:9999) pre-seeded in quoteejb |
MAX_HOLDINGS | 10 | Maximum number of open holdings per user; scenario servlet avoids buying beyond this limit |