You can also let the update happen and handle the Exception that will
follow. This is an application level problem.
Hadrian
On 06/14/2011 02:27 AM, Claus Ibsen wrote:
On Mon, Jun 13, 2011 at 1:08 PM, woggle23<mattfelst...@yahoo.co.uk> wrote:
Morning Team
I have a system with 2 routes similar to the following:
HTTP Endpoint -> xmlToSql -> JDBC -> insert/update -> JDBC
POLL-Database -> JDBC -> update/delete -> JDBC
The 1st route receives an xml message via HTTP, then perfoms a query on the
database (to find if an entry relating to the received message already
exists). The outcome of this query is used to generate a 2nd query to insert
the new message, or update the existing message in the database.
The 2nd route performs a timed poll of the database to remove any redundant
entires, which is performed via 2 queries; 1 to read out the entire
contents, the other to update or delete entries based on the outcome of the
initial query.
Due to multi-threading there is potential for route 2 to delete an entry
moments prior to route 1 attempting to update that same entry. How is this
kind of problem tackled in Camel
Well its a JDCB issue. Thats a general problem. There are ways to
configure isolation levels and whatnot on the JDBC so you can control
this.
An alternative is in the 2nd route to "detect" that the 1st route is
active, and then it just skip doing anything this time.
Or something like that.
Many thanks in advance
Matt
--
View this message in context:
http://camel.465427.n5.nabble.com/Multi-threading-query-tp4483959p4483959.html
Sent from the Camel - Users mailing list archive at Nabble.com.