The Hibernate Network Proxy, A Dumb Idea.

A friend of mine had a good idea for a Java project named “hibernate proxy”. I renamed it “hibernate network proxy” because hibernate proxies are already a well known concept among hibernate users (it allows lazy loading through a Java Proxy class).

The hibernate network proxy, is a way to use hibernate remotely, that is to proxy hibernate calls through TCP (or even HTTP) to another machine, that will execute the session.saveOrUpdate or the session.load, etc. calls and return the corresponding objects, serialize them and deserialize them for use on the client. As most projects in my company involves several distributed services, this idea could have been potentially very interesting, allowing hibernate use in several services that would interact with a common service in charge of the db. It made me think about other standard patterns:

The last solution raises the most important question:

Why does it need to be proxied?

To go through some particular port? -> use a port forwarder. To go through HTTP? -> use HTTPTunnel. You want Java only? ->use JHttpTunnel,there is even JSch for ssh.

Comments

comments powered by Disqus