-
1. Re: BMP, file and transaction
marc.fleury Oct 10, 2001 5:31 PM (in response to rfred999)
> My question
> when we use bmp, are transactions managed? for
> example, in a session bean, we create, update and
> distroy many entity beans. if an operation failed,
> how cancel previous operations, like update and
> detroy methods? is it automatic? if yes, what jboss
> do to do that?
Yes it is automatic in CMT (Container Managed Transaction) which is the only setting for entities. You control it with the same tags. -
2. Re: BMP, file and transaction
davidjencks Oct 10, 2001 5:57 PM (in response to rfred999)You may want to find a more up to date tutorial on ejb's. The jboss manual has some accurate info.
Unless you write a file-based jca resource adapter, you shouldn't use files to store your entity bean state: you aren't supposed to write to files from an ejb. Furthermore, most file systems are not transactional: there is normally no "commit" operation on a file write. So although jboss will happily try to manage transactions for you with BMP entity beans, if you don't have a transactional resource manager (database) it won't do you any good: there is nothing to do the commit or rollback on.
So, if I understood your question correctly to be about using file based persistence with bmp, it is not safe. -
3. Re: BMP, file and transaction
rfred999 Oct 11, 2001 5:34 AM (in response to rfred999)> You may want to find a more up to date tutorial on
> ejb's. The jboss manual has some accurate info.
>
> Unless you write a file-based jca resource adapter,
> you shouldn't use files to store your entity bean
> state: you aren't supposed to write to files from an
> ejb. Furthermore, most file systems are not
> transactional: there is normally no "commit"
> operation on a file write. So although jboss will
> happily try to manage transactions for you with BMP
> entity beans, if you don't have a transactional
> resource manager (database) it won't do you any good:
> there is nothing to do the commit or rollback on.
>
> So, if I understood your question correctly to be
> about using file based persistence with bmp, it is
> not safe.
So, using file is not safe. But have we a solution? We want to store our data in xml file.