The problems you will get:
- a big memory leak: The session keeps every entity in a big map after it touches it once. So after some time you will have the complete database in memory (assuming you have that much memory)
- stale data problems: By default the session keeps the original state of an entity. If you want to see the current state (changed by a different instance of your app for example) you'll have to refresh manually ... and I personally hate everything with 'manually' in it, because it is error prone
- inconsistent data: Now if you refresh part of your objects, you might work with some objects from the beginning of the day, and other from just now ... not a nice situation
The single session aproach works if your application gets restartet often and doesn't use to much data in a single run.
I'd recommend using one session per Dialog/Frame, except for modal Dialogs which use the session of their parent Dialog/frame. Use a Director pattern to control the Frames and their respective Sessions. I wrote a blog article about
Hibernate in 2-tier applications (it's german, but maybe it is of some help anyway)[/url]