8 Replies Latest reply on Mar 18, 2005 3:23 AM by Alex Paransky

    Adding <read-only>true</read-only> on method increased # of

    Alex Paransky Newbie

      I have an application which runs quite fast. Recently I discovered that under heavy load I get Deadlock exceptions raised from JBOSS (3.2.3). I noticed that the Deadlock exception occurs during a READ-ONLY operation and decided to mark all my get* is* has* methods with read-only attribute. For some reason, this has changed a single SELECT statement into many in the form of SELECT ... WHERE (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) OR (ID=?) .... Because of this, a page that used to load in under second now took over 8 seconds to load.

      I removed the read-only method specifications and the number of SELECT statements returned back to normal and performance increased.

      Can someone please explain why would read-only method annotation increase the number of SELECT statements to such an extent?