Hi!
Shelly Aggrawal wrote:
> I am new to EJB's. Please solve my basic problem regarding transaction rollbacks:
> I have a transaction in which i want to write data to two files: 'personal' and
>'official'.
>
> For the two files i have two different beans.( I know that better design would be
>to have a single bean, but my problem is better illustrated this way)
> Within the client transaction i call create() of 'personal' followed by create()
>of 'official'.
> If the create of 'official' failed because of some reason, the client transaction
>will be rolled back.
> But by this time, ejbstore() of 'personal' would already have been called, which
>will mean that record has been written to the database. In case of rollback will the
>new record written to the 'personal' be deleted or retained.
If your database can work with the transaction manager of the EJB
server, *and* it supports 2 phase commit, then it should work just fine.
That's the whole point with 2PC: to be able to handle what you just
described.
2PC hooks are part of JDBC2.0, so you will want to check if:
* Your database supports 2 phase commit/transactions
* Your database driver supports JDBC2.0
* Your EJB server supports JDBC2.0
* Your EJB server supports JTA
* Your EJB server supports your database
Trivial, eh 8-)
There's no such thing as free lunch...
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".