I'm looking for some advice in how one would structure a hibernate driven swing application that can have multiple users, connecting to a database sat on a remote server away from the actual swing app. Currently, every instance of the application creates its own session factory and i have implemented my own handling of individual sessions in the swing app that currently seems to be *ok* for the multi user aspects. (I say *ok*, but am on the lookout for cleaner pattern for this).
Lets suppose i wanted to limit access to the database on the server, so that only local connections where allowed. Would this be feasible in an application like I describe?
Some ideas i have had include setting up a JBoss server on the server and configuring datasources through JNDI. I've also seen you can expose the actual SessionFactory as a resource through JNDI, although its not obvious to me how this would work in a remote swing app? I have no practical experience of using an application server like JBoss, so am unaware really of its power/limitations in this regard. I guess, this is the thrust of my post, what are the capabilities of such an approach?
Or perhaps other developers can share there own experiences of a similar scenario and give me some food for thought with a different approach?
Thanks for any advice
Marcus.