In BEA Weblogic, if I have written a CMP Entity bean & want to deploy it, is it mandatory that I have to mention a "connection pool" when deploying my Entity Bean ?
The "examples" server instance (or domain) that comes with Weblogic has a prebuilt connection pool called "demoPool". But in one of Weblogic's sample for a CMP Entity Bean, it is nowehere clearly mentioned that the Entity bean should use the "demoPool".
I mean, am I supposed to associate an Entity bean with a connection pool ? If so, where do I do it ?
ok, I think I got the short term answer I was looking for.
I saw that there is another thing called as a "data source". The EJB deployment descriptor contains the name of a "data source", which in turn points to a "connection pool". So, now I know how a connection pool is associated with a Bean.
I still do not understand WHY there are two of these things - i.e. "data source" & a "connection pool". I definitely need to read more about Weblogic, but just seems absurd that they've created unnecessary confusion for such a straight forward thing.
What I understood from "data source" & "connectionpool" is that "data source" can be used to get a connection out of the predefined "connection pool" , is used while writing BMP Entity Beans, where connection to the database can be obtained by using the "data source" name in the JNDI lookup.
While in CMP , container uses the connection pool to connect to database time at runtime.
Please correct me if I am wrong.
What I think is a connection pool is a pool of datasouces which would be used by both CMP and BMP Entity Beans.
In case of CMP, we woulld still specify the datasource name in the deployment descriptor and the connection pool on weblogic console.
Please correct me if wrong.
Adding to Guddu and sujata's views, its just a way of decoupling the more general "connection pool" from the CMP specific "data source" in the deployment descriptor.
For CMPs, we associate, one of the existing connection pools as the data source.
The whole idea is just to decouple.
Hope, i got it clear.