-
1. Re: CMR EJB QL row locking
attachvishal Sep 4, 2002 11:52 AM (in response to attachvishal)i have a method which is defined as read only in jboss.xml and which run this above ejbql.And the entity bean is defined as row locking in jbosscmp-jdbc.xml .
now if i assumes that that the read only methods doesn;t included in any type of transactions or lock the bean within the transaction. every time jboss runs this ql it also runs this below query after parsed query is executed
SELECT PHONE_NUMBER, EXTENSION, PHONE_TYP, U_VERSION, CNORIGIN, CNCUSTOMER FROM CNCUSTOMER_PHONE WHERE (CNCUSTOMER_PHONE=?) FOR UPDATE
this means even if u have defined ur method as read only it will lock the rows. -
2. Re: CMR EJB QL row locking
dsundstrom Sep 4, 2002 12:16 PM (in response to attachvishal)The container configuration read-only is compeletely seperate from JBossCMP. We hope to fix this problem in JBoss 4. In the mean time I suppose it would be useful to be able to add a row-locing option to the query elements. If you agree post a feature request at source forge.
-
3. Re: CMR EJB QL row locking
attachvishal Sep 4, 2002 1:44 PM (in response to attachvishal)i think it depends on the EJBQL. If EQLQL has a relationship and we add FOR UPDATE to the query generated like for my case the query will not be valid query for the database.i tried the same query in ORACLE sqlplus and i got this result
SELECT DISTINCT t0_phone.CNCUSTOMER_PHONE FROM CNCUSTOMER t1_cust, CNADDRESS t2_address, CNCUSTOMER_PHONE t0_phone WHERE (t1_cust.CNCUSTOMER = 10003 AND t2_address.CURRENT_FLG = 'F' AND t2_address.OCCUP_FLG = 'T' AND t2_address.ADDRESS_TYP = 216) AND (t1_cust.CNCUSTOMER=t0_phone.CNCUSTOMER AND t1_cust.CNCUSTOMER=t2_address.CNCUSTOMER) FOR UPDATE
ERROR at line 1:
ORA-01786: FOR UPDATE of this query expression is not allowed -
4. Re: CMR EJB QL row locking
dsundstrom Sep 6, 2002 4:39 PM (in response to attachvishal)So I guess this will be a use at your own risk type query. As long as it is simple it will work.