Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are two distinct problems, that should get resolved seperately:</p> <ol> <li>Handling of Hibernate Sessions in Swing Applications. Let me recommend my own article, regarding this problem: <a href="http://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-tier-rich-client-applications/" rel="nofollow noreferrer">http://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-tier-rich-client-applications/</a></li> </ol> <p>The basic idea is to have a session for every frame, excluding modal frames which use the session of the spawning frame. It is not easy but it works. Meaning, you won't get any LLEs anymore.</p> <ol start="2"> <li>How to get your GUI thread separated from the back end.</li> </ol> <p>I recommend to keep the hibernate objects strictly on the back end thread they originate from. Only give wrapper objects to the ETD. If these wrapper objects are asked for a value, they create a request which gets passed to the backend thread, which eventually will return the value.</p> <p>I'd envision three kinds of wrapper Implementations:</p> <p><strong>Async</strong>: requests the value, and gets notified when the value is available. It would return immediately with some dummy value. On notification it will fire a PropertyChange event i.O. to inform the GUI about the 'changed' value (changed from unknown to a real value).</p> <p><strong>Sync</strong>: requests the value and waits for it to be available.</p> <p><strong>Timed</strong>: a mixture between the two, waiting for a short time (0.01) seconds, before returning. This would avoid plenty change events, compared to the async version.</p> <p>As a basis for these wrappers a recommend the ValueModel of the JGoodies Binding library: <a href="http://www.jgoodies.com/downloads/libraries.html" rel="nofollow noreferrer">http://www.jgoodies.com/downloads/libraries.html</a></p> <p>Obviously You need to take care that any action is only performed on actually loaded values, but since you don't plan on doing updates this shouldn't be to much of an issue.</p> <p>Let me end with a warning: I have thought about it a lot, but never actually tried it, so move with care.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload