No, it's because the JDBC Connection that you obtain via
InitialConetext.lookup("java:comp/env/MyContainerConnection" won't allow you to
manually commit a transaction unless you specify to the container using that you are
willing to take that responsibility and do it properly.
Also, you can only specify bean-managed-transactions on Session Beans:
<quote>
The Bean Provider of a Session Bean must use the transaction-type element to declare
whether the Session Bean is of the bean-managed or container-managed transaction
demarcation type. (See Chapter 16 for information about the deployment descriptor.)
The transaction-type element is not supported for Entity beans because all Entity
beans must use container-managed transaction demarcation.
</quote>
( See 11.3.2 and 11.3.3 and 11.3.5 in the EJB 1.1 spec )
It has nothing to do whatsoever with a 'longstanding bug in Weblogic' regarding
autocommit. If you are going to attempt to discredit a competitor, please do so in an
informed way.
I like Inprise Application Server as a product, but Jonathon, your 'advocacy' of it on
this list has increased my sales *resistance* by at least a factor of 3. If your
'customer graces' are representative of Inprise, then I don't want to do business with
Inprise.
Reddy, I think you would do well to read the EJB 1.1 spec, if you are really wanting
to to transactional stuff inside your EJB's. Basically, the best (and only) approach
for BMP Beans to take is to let the container manage the transactions on your JDBC
connections - just do your work - don't make any calls to Connection.commit() or
Connection.rollback() yourself.
regards,
David.
On Mon, 22 Jan 2001, Jonathan Weedon wrote:
> I may be way off base here, but this looks very much like a long-standing
> bug in WebLogic.
>
> -jkw
>
> E Bakka Reddy wrote:
> >
> > Hi Ardianto,
> >
> > Yes, we have used the same, but not working.
> >
> > for more details read the following:
> >
> > We are facing problem with controlling the trasaction at entity bean side
> > by using javax.transaction. UserTransaction
> >
> > We have two insert stmts in BMP of create method under a single
> > transaction(u.begin();..insert stmt1, insert stmt2...u.commit();, even if
> > second fails, first stmt is commiting and even we caught sqlexception and
> > written rollback stmt there...u.rollback(), samething happeneing here also.
> >
> > Second way we tried as getUserTransaction on entitycontext, but while
> > running the application, it is throwing an exception saying that
> > TX_BEAN_MANAGED is not set. But we dont know how to set the
> > TX_BEAN_MANAGED.
> >
> > But, from client side we are able to do this( one insert stmt in create
> > method and call it two times from client under userTransaction Scope, it's
> > working fine, i.e., calling the create method twice)
> >
> > Please, guide us, whether we can put multiple stmts in entity beans under
> > single transaction scope or not.
> >
> > Thanks,
> > Reddy
> >
David Bullock
Project Lead
email: [EMAIL PROTECTED]
mobile: +61 4 0290 1228
"The key ingredients of success are a crystal-clear goal,
a realistic attack plan to achieve that goal,
and consistent, daily action to reach that goal."
Steve Maguire, "Debugging the Development Process".
LISAsoft
http://www.lisasoft.com/
Adelaide Sydney
-------------------- ------------------------
38 Greenhill Rd Level 3, 228 Pitt Street
Wayville S.A. 5034 Sydney NSW 2000
Australia Australia
PH +61 8 8272 1555 PH +61 2 9283 0877
FAX +61 8 8271 1199 FAX +61 2 9283 0866
-------------------- ------------------------
===========================================================================
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".