Hi Gary,

I implemented a large system currently in production using BMP and TOPLink for Java 
(not WebLogic).  I can't go into all the gory details, but in short this is what we
did:

Implement all transactions (system operations) on session beans as TX_REQUIRED.
Any entity bean method that modifies the domain should be set to TX_MANDATORY.
Set all bean methods everywhere to CLIENT_IDENTITY.
Provide a user login method on a session bean.
Implement a user context dictionary that keeps track of all the currently connected 
users by their Identity/Principle.
When a user logs in, create a TOPLink client session for them.
Implement the SessionSynchronization interface in all session beans.
During afterBegin, look up the TOPLink client session by the caller's identity, create 
a unit of work for the user, and store it in the user's context.  Also register a
transaction synchronization adapter using the server's JTA implementation (or 
equivalent).
As entity beans change, keep track of the changed domain objects in a collection for 
each entity bean.
During every ejbStore, look up the UOW by the caller's identity and merge the changed 
objects into it.
When the transaction adapter gets a prepare call, commit the TOPLink unit of work.  If 
an exception is thrown, vote to rollback.

There are a lot of little things you will have to deal with, like the fact that 
ejbCreate has to return the primary key of a new entity, but (if you are using sequence
generators in the database) TOPLink won't generate the PK until the transaction is 
committed.  We were able to solve al these problems, but I can assure you that the
overall task of integrating TOPLink with BMP is non-trivial.

Most of the code can be implemented in abstract super classes, so that individual 
bean's don't know anything about all this.

Good luck!

--Chip

Gary Swatton wrote:

> Hi Chuck,
>
> Are you using TOPLink (TL) for Java 2.0 or TOPLink for WebLogic?  Are you utilizing 
>UnitOfWork (UOW) within your EntityBeans (EB) or just utilizing TL's Sessions?
>
> I haven't been able to figure out how to set up my EB's to utilize UOW's (because 
>EB's are shared and by definition, UOW's are one per user).
>
> I've tried to set up the UOW's encapsulated inside a SessionBean (SB) per client, 
>but don't know how to identify which Client is modifying the EB from the Server EB.
>
> Any insight would be helpful.
>
> Thanks,
>
> Gary
>
begin:vcard
n:Wilson;Chip
tel;fax:(214) 358-0353
tel;work:(214) 642-4559
x-mozilla-html:TRUE
url:http://www.axyssolutions.com/
org:Axys Solutions
adr:;;;Dallas;TX;;
version:2.1
email;internet:[EMAIL PROTECTED]
title:Application Architect
note:Sun Certified Java Architect
x-mozilla-cpt:;-25088
fn:Chip Wilson
end:vcard

Reply via email to