"Bhattacharyya, Ana" wrote:
> Hi all
> I am using weblogic 5.0 beta for my project. I have the following doubts
> which needs to te cleared before I can proceed further with the design.
>
> I want to connect to an Oracle8i database.What are the options I have ---
> 1. Use Weblogics driver -- if it has one (Not sure whether it has one for
> Oracle8i).
> 2. Use Oracles thin driver.
> If I go for the 2nd option can I use the connection pooling mechanism of
> weblogic?? ie the question
> basically boils down to whether I can use a driver of my choice and still
> develope a connection pool
> using weblogic.properties file.
>
Yes, I do it with success.
>
> I am planning to use both session beans and entity beans in my project.
> Session beans will act a facade
> to the entity beans. The clients will never access the entity beans
> directly. Clients will allways
> request the session bean which in turn may redirect the request to the
> entity bean and aswell do some
> business validations/transactions. I am planning to use CMP for entity beans
> and normal JDBC
> access for Session beans. All the methods will have transaction attribute
> set as TX_REQUIRED. I will
> use the thin JDBC driver for Oracle8i. I want to use connection pooling
> also.
> Lets take a practical scenarion now. The client sends some data to the
> session bean to create an Account.
> The session bean first validates the data and then calls the CMP Entity
> beans create. Then it does some
> modification in the database and then returns. I want the whole thing to
> happen in one transaction.
> The problem is I am not going to write a single line of JDBC code for the
> entity bean. But I will have to
> write JDBC code for the database interactions the session bean is doing. So
> can the container manage this
> for me?? ie I will be taking a connection for the session bean operation and
> container will be taking a connection
> for entity bean operation --- how does it do the synchronization of these
> two connections???
>
The connection pooling mechanism takes care of this. When you require a
connection to the datasource, it returns the connection already associated to
the current transaction if it exists. You don't have to care about this. You
have to be aware, however, that if your session bean tries to access data just
created or modified by your entity bean (in the same transaction), it won't see
the modifications, since they will only occur at commit time. You can change
this behaviour by setting a flag (delay-update-until-end-of-tx IIRC) to false,
but this will decrease your performance.
JB.
>
> TIA
> Anamitra
>
> ===========================================================================
> 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".
--
Jean-Baptiste Nizet
[EMAIL PROTECTED]
R&D Engineer, S1 Belgium
Excelsiorlaan 87
B-1930 Zaventem
+32 2 714 45 42
===========================================================================
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".