|
|
multiple jdbctemplate queries not aware of each other?
Hi, I'm using Spring with Hibernate.
I have 2 queries made using JDBCTemplate.query() .
The first query updates a column value.
The second query uses the updated values to identify which records to update next.
On the second query, I observed inconsistent behaviour in the sense that the second query sometimes doesn't 'know' the updates made from the first query.
Any idea what might cause this problem?
TIA.
How are you managing transactions in the application?
docs/...ansaction.html
Originally Posted by bayurHi, I'm using Spring with Hibernate.
I have 2 queries made using JDBCTemplate.query() .
The first query updates a column value.
The second query uses the updated values to identify which records to update next.
On the second query, I observed inconsistent behaviour in the sense that the second query sometimes doesn't 'know' the updates made from the first query.
Any idea what might cause this problem?
TIA.
As karldmoore has said it is all about transaction (and sessions, and threads).
Most likely scenario - your queries run from different sessions and sometimes results of first query are commited before second query runs and sometimes - not. Very likely, if queries run from different threads. |
|