We're seeing a write delay to Postgresql db. Please advise on what might be the problem.
JBoss version: 4.0.1
Postgres version: 7.4.6
Hibernate version: 2.1.6
Components: External Client (A), Stateless Session Bean (B), External Listener (C)
1. A calls B.insertRow(..) B uses hibernate to save the data. save(), flush(), commit() used on the Session.
2. On return from insertRow(..) A checks DB for that new Row.
Results: Loop 1000 times, A finds the row in DB every single time.
1. A calls B.insertRow(..) B uses direct JDBC connection from jboss datasource to insert row.
2. On return from insertRow(..) A checks DB for new Row.
Results: Loop 1000 times and no failure to find at all.
Test 3 & 4:
1. A calls B.insertRow(..) B uses hibernate/jdbc to insert.
2. Right after insert, B sends a request to C (via tcp socket)
3. C checks DB for new row.
Results: Loop 1000 times and probably about 20% of the time it cannot find the row in the DB.
We've looked at different JBoss docs and tried switching pgsql jdbc driver with no success.
Please provide some insights.