Hi,

I have a BMP entity bean that maps to an Oracle table with a CLOB field. I
can read the CLOB in OK but when trying to write to it I get an 'ORA-01002:
fetch out of sequence' error. 

This error can be caused by a commit being called between retrieving the
CLOB locator with a SELECT... FOR UPDATE and trying to write to the CLOB's
output stream. 

I solved this for ejbCreate() by setting the create() method's transaction
attribute to 'Required'. However, I can't give the ejbStore() method a
transaction attribute as it can only be called by the container. 

I have got around this like so: 

By default, ejbStore() is called by the container after every call to any
method in the bean instance, whether or not the bean's state is changed.
Implementing the public boolean isModified() method stops ejbStore() being
called every time as the container first checks that true is returned by
this method. Setting a 'Required', 'Requires New' or 'Mandatory' transaction
attribute for all methods that set the 'modified' boolean to true seems to
ensure that ejbStore() is now only called inside a transaction.

This seems to solve the problem but I'd like to be sure that my assumptions
are correct and that this WILL prevent ejbStore() from ever being called
outside a transaction. Also, is it possible to set a 
transaction attribute for ejbStore()?

Thanks,

Paul



http://www.iii.co.uk 
Interactive Investor International is a leading UK Internet personal 
finance service that provides individuals with the capability to identify, 
compare, monitor and buy online a number of financial products and services.

Interactive Investor Trading Limited, a subsidiary of Interactive Investor 
International plc, is regulated by the SFA.

Reply via email to