Can some one tell me whats wrong with this query
UPDATE trans_actual SET comment_id = ?
WHERE id = (SELECT MAX(id)
FROM trans_actual
WHERE plan_id = ?)
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar SQLExcept开发者_运维百科ion: ORA-02049: timeout: distributed transaction waiting for lock
Its working fine in SQLDeveleloper.
The query looks fine. It looks like a transaction lock problem. In this kind of problem, only you can determine where the lock is because you cannot post your whole code here.
Also, you might have other apps accessing the same database. You have to check for transaction isolation levels, concurrency, the whole nine yards.
Have you searched for ORA-02049? It should give you some hints.
精彩评论