Hello,
According to the documentation, Hibernate guarantees id consistency within the same session (one id in the database corresponds to one and only java object - for a particular class).
I am building a fat client (swing gui etc), that will talk to a MySQL database through Hibernate, and it seems like a good idea to use a single session with multiple transactions for the duration of the runtime of the client. This would have the advantage that hibernate would keep track of what's loaded and what's not, instead of me implementing it.
Are sessions meant to be used like that? Does the fact that I will have a single session has any resource implications given that multiple clients will be connected at the same time? Should I be reconnecting/disconnecting the session before/after each of the transactions?
Thanks,
_________________ Stathis Sideris
|