0 Replies Latest reply on Feb 9, 2007 11:15 AM by Stefano Gallina

    DeadLock problem !

    Stefano Gallina Newbie

      Hi everybody,

      i have a problem about deadlock on a table.
      I have twomethod inside a Session EJB.
      The first does a run a SELECT statament on the table TEST to get some data and put them insiede an ArrayList, then i use this ArrayList to display data on a report.
      The second method does and insert statement into the table TEST.
      Well, the table TEST contains about 500.000 records and the database is IBM DB2.
      When I launch the first method to create the report and, while it is running, I call the second method i get a DEADLOCK error because it seems that the first method LOCKS the entire table TEST.
      I know that calling a method inside a Session EJB i start a transaction, so could be right put the first method outside the Session EJB to avoid the start of the transaction ?
      Any suggestion ?
      I have a doubt, everytime i open a connection (outsidea Session EJB) to a database do i start a trnsaction anyway ?
      Any suggestion ?