One of the developers on my team came up with an idea for our Swing application (in which there is a single DB updated only by the one app, which means fewer data consistency issues).
Open a Session at the beginning of each write-Action and leave it open until the beginning of the next write-Action. Read-only data accesses such as, scrolling to a different part of a JList, never have to reattach detached objects.
This is a variant of the Session-per-User-Transaction design pattern (
http://www.hibernate.org/168.html). It does mean that Sessions can be open for a long time
between Transactions.
This relies on never having any Hibernate exceptions in the read-only data accesses, otherwise the Session is messed up until the next write-Action begins.