Hi, I'm using jboss cache 1.4.1.SP3 and implementing a custom cache loader (that uses a database). How can I tell when a new node is inserted and when an existing node is updated? Right now the only way I found is to query the database for the node's record. I need this information in order to decide whether to do an INSERT or an UPDATE. But this extra SELECT query is clumsy and should be redundant. How can I get rid of it?
Some DBs support "UPDATE OR INSERT" sort of statements.
My suggestion would be to use a stored procedure for this, though.