JPA and desktop apps

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: PG-JDBC Mailing List <pgsql-jdbc(at)postgresql(dot)org>
Subject: JPA and desktop apps
Date: 2010-07-22 03:07:35
Message-ID: 4C47B5F7.4050303@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Samuel Gendler 2010-07-22 06:31:45 Re: JPA and desktop apps
Previous Message Radosław Smogura 2010-07-20 21:17:09 Re: Binary protocol support for JDBC