How to doAction concurrently?

View: New views
4 Messages — Rating Filter:   Alert me  

How to doAction concurrently?

by vishalj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi
    In my application, catch the exception infomation as follows:
   
com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '1461' for key 1
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1585)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1500)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1485)
        at com.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore.moveToHistory(JDBCWorkflowStore.java:541)

========================================================

There are many threads invoke doAction concurrently. is it the reason of this error?
Maybe  doAction method can be reentried, and destroy database's consistency?
how to solve this problem?

Thanks!
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=396039&messageID=483129#483129


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: How to doAction concurrently?

by vishalj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Look into using MySQLWorkflowStore instead of JDBCWorkflowStore.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=396039&messageID=483732#483732


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: How to doAction concurrently?

by vishalj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Although I guess that wouldn't help with any concurrency issues you are having. I don't think any of the provided implementations of Workflow or WorkflowStore are thread safe. You can do any one of the following:

- Ensure that you Workflow instance is only ever used in one thread by not reusing the same instance
- Synchronize access to any Workflow instances that are shared between threads
- Create a thread-safe implementation of Workflow
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=396039&messageID=483733#483733


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: How to doAction concurrently?

by vishalj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In the past I have found that this problem is usually due to how you setup the sequences for your step IDs.

Could post your config?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=396039&messageID=503461#503461


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price!