Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with returned primary key in paralell requests

    We have found some erroneous data in our system and could not find the source.
    After some investigation we think that in some cases the returned primary key to a request was from another request, which was executed paralell.
    Those paralell requests usually are from a different REST-API call or by a timed task which does multiple requests in a Thread.

    When we tried to reproduce the situation, we found the following error message at one point:
    getLastPrimaryKeys() called before valid insert/replace/update operation has been performed
    In this case no erroneous data is created because the request is stopped.

    We seem to have this issue from past versions to the current one (power, nightly 12.0p).
    This seems to happen very rare (1 in 100.000 requests) so its hard to provide a reproducible code snippet or logs.

    Do you have an idea why this might happen or how we could track this down?
    What information do we need to provide you to help us?

    System information:
    OS: CentOS 7.6.1810
    Database: 5.5.64-MariaDB
    Webserver: Apache Tomcat/7.0.76
    DB Driver: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
    SmartGWT Power v12.0p

    EDIT: Please move thread to Smart GWT Technical Q&A.
    Last edited by escrea; 12 Nov 2019, 04:02.

    #2
    If this is a concurrency issues occurs 1 in 100,000 times, then you should be able to create a test case that spawns 1,000 spread and executes 1,000 operations each, and reproduce the problem pretty consistently.

    Without such a test case, there's not much we can offer but speculation. It's probably not our bug, since that portion of our code does not share any objects between different execution threads. So if you've found a bug, it's probably in Maria's JDBC driver or in standard Apache Commons pooling libraries - you might try getting the latest of each of those.

    Comment

    Working...
    X