JPA and desktop apps - Mailing list pgsql-jdbc

From Craig Ringer
Subject JPA and desktop apps
Date
Msg-id 4C47B5F7.4050303@postnewspapers.com.au
Whole thread Raw
Responses Re: JPA and desktop apps  (Samuel Gendler <sgendler@ideasculptor.com>)
Re: JPA and desktop apps  (Lew <noone@lewscanon.com>)
List pgsql-jdbc
Hi all

This is mildly OT, so please ignore unless you're interested in and work
with PostgreSQL via JPA/Hibernate/EclipseLink/etc in a desktop app setting.

Ages ago, I asked here if others were using JDBC directly to access Pg
from their java apps, or if they were using an ORM. I sought advice.
Many suggested that an ORM was a strongly preferable option, and partly
as a result of that advice I ended up using the JPA interface (with
Hibernate powering it) for my database access in my Swing app.

I've now concluded that, while it seems great on the surface, that
approach is absolutely awful, because of issues with detatched entities,
lazy property fetching, and the need to run database work on a non-EDT
thread to avoid UI stalls/freezes and repaint delays.

More details here:

http://soapyfrogs.blogspot.com/2010/07/jpa-and-hibernateeclipselinkopenjpaetc.html

Anyway, since folks here advised me to go for an ORM like Hibernate, I'm
curious: How do you handle the need to avoid blocking on database access
in your Java GUI apps, while lazily fetching properties of entities to
avoid downloading half the database whenever you query it for anything?

--
Craig Ringe

pgsql-jdbc by date:

Previous
From: Radosław Smogura
Date:
Subject: Re: Binary protocol support for JDBC
Next
From: Samuel Gendler
Date:
Subject: Re: JPA and desktop apps