> From where that transaction context comes if I dont use session beans etc
> with transaction attributes set.
>...
>If I am not using EJbs , why that would be silly. Where I will commit my
>transaction.

In J2EE you use the User Transaction interface to begin/commit/rollback
transactions - either indirectly using EJB and container-managed
transactions or directly. But you never use the commit/rollback methods of
the jdbc Connection interface. This model is fundamental for creating
autonomous components that can be composed into systems. Each component (EJB
or any Java class called within an app-server controlled transaction) can
create, use and close jdbc connections as if they were the complete business
logic. When several components are called in the same app server
transaction, each of them will get a datasource, create a connection, use it
and close it - but never call commit/rollback on it. The app server or EJB
container will assure that the same (open) jdbc connection is handed over to
each of the components when they ask a datasource to "create" a jdbc
connection.
There is a lot more to say on this topic, but it will hopefully give you an
idea of the responsibility of the application server vs. the programmer
(component provider).
You do not have to use EJBs to get the programming model outlined above. If
your application is a web component, you can look-up and use the User
Transaction directly from your servlet (to begin and commit the
transaction). You can then use regular Java Beans / classes to access/update
the database using datasources and jdbc connections exactly the same way as
you would if you coded jdbc calls in your session- or BMP EJBs.
/Johan

===========================================================================
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".

Reply via email to