2 Replies Latest reply on Mar 20, 2008 10:26 AM by mars1412

    newbie: EntityHome and Locking

    mars1412 Apprentice

      I just noticed following issue, that I can't understand.


      I set a breakpoint before


      getEntityManager().flush();



      in the seam EntityHome component.


      In a command window I start sqlcmd (MS-Sql Servers commandline interface) and select the entity that I am about to change.


      select * from MyEntity where id = 1;



      This works as expected.


      Then in the debugger I execute the flush() statement.


      When I now try to do the same select in my command window, the select blocks, until I resume my debugging session.
      As soon as the debugged transaction is committed, the select in the command window resumes and gives me the results.


      What is going on here??


      How can the update-statement in my debugging session block a select (!) statement in another transaction (that even exists in another process)?


      If I issued another update in the command window this behaviour would be ok. But not for a select, where I only read the data.



      I hope someone can enlighten me.