Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Request for Feedback: EclipseLink in Large RCP Application (J2SE)

After bouncing around the wiki and toplink/eclipselink docs for an
afternoon and implementing a proof of concept, we've formulated a plan
for implementing EclipseLink as the database layer. This looks like it
will work, however we  appreciate some feedback in the feasibility of
this strategy as well any obviously stupid
assumptions/mistakes/gotchas.

Environment:
Client: Large J2SE RCP Application
Database: PostgreSQL databases behind proxy (this handles
fail-over,connection pooling, auto-commit is ON)

Application Requirements:
Standard database backed application, using Editors to do most
inserts/updates this requires detecting a "dirty" (changed) state,
reverting to original, getting specific differences, etc.

Strategy:
Use EclipseLink's EntityManager implementation (configured
programatically) to handle all connections, we're not using
eclipselink's native sessions (defined by sessions.xml) because  we
didn't care for it's query language vs the pure JPA query language.

Take advantage of the getUnitOfWork() method to leverage UnitOfWork
methods such as hasChanges(), etc. to handle keeping track of object
states.
So we hard-cast like:

((EntityManagerImpl)em).getUnitOfWork().hasChanges();

Anything that needs to do database work will have it's own "Model"
implementation consisting of an EntityManager and UOW(s). I won't go
into detail here about databinding, etc. but we plan on leveraging JPA
annotations to take some nice shortcuts there.

Once we've got a nice CRUD implemented I'll probably publish the code
and blog about it since there doesn't seem to be any RCP CRUD examples
up yet.

-- 
./tch


Back to the top