java - Is it possible to get the current database state with Hibernate? -
basically, want current database state in every client each time database state changes.
let's suppose have 2 computers, each 1 running same java application, , postgresql in server.
when client connected server , operation persists object (let's person) database, persisted object fields (let's id, name, surname) appear in client's main window executed operation, named fields doesn't appear in other client's window.
my 2 clients can connect server perfectly.
if think piece of code help, let me know.
by way, i've heard called "server push", can want do?
albert.
ps: sorry mistakes, english isn't :p
you'll want make use of postgresql's listen/notify capability.
here's example using jdbc (http://wiki.postgresql.org/wiki/pgnotificationpoller)
likewise, how make database listener java? has more hibernate-y resources provided.
essentially, @ highest level, you'll use background thread poll server see if there notify events channel want updates. if update present, can update gui accordingly.
Comments
Post a Comment