0 Replies Latest reply on Jun 5, 2006 5:24 AM by Timothy Drummond

    UPDATES in Read only calls.

    Timothy Drummond Newbie

      Using JBoss 3.2.3

      I'm having an issue with deadlocking.
      I'm using p6spy to look at the SQL calls when debugging.
      Can some one help me out.

      I call
      private AdvertLocal findAdvert(String sessionId) throws FinderException
      return advertHome.findBySessionId(sessionId);

      In the ejb-jar.xml the findBySessionId is wriiten like so

      <![CDATA[Finds an advert by a user session ID.]]>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(a) FROM Advert a WHERE a.sessionId = ?1]]></ejb-ql>

      In the p6spy log I get an UPDATE statement then about 10 lines of SELECT statements and then the commit. This commit needs to happen straight away after the UPDATE. Does any one know why this is?
      Why is there an UPDATE statement when the original sql in the ejb-jar.xml file is a SELECT statement?