I have seen this solution in J2EE Tutorial at
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/BMP.html
This solution is also in accordance with the
article “Seven Rules for Optimizing Entity Beans“ at
http://developer.java.sun.com/developer/technicalArticles/ebeans/sevenrules/
(rule 4).
However, it seems that Weblogic 5.1 does not support such a
solution. When I run my client program for the first time,
everything is OK. But when I start my client program one more
time, I get the following exception on the server side:
java.sql.SQLException: java.lang.NullPointerException
at weblogic.jdbc20.rmi.SerialConnection.prepareStatement
(SerialConnection.java:61)
.at ...
It seems that BMP Entity Bean in Weblogic looses the
connection when it goes from READY state to POOLED state
and then back to READY state again.
It’s interesting that a Weblogic 5.1 example (at
\weblogic\examples\ejb\basic\beanManaged) uses JNDI
lookup and DataSource.getConnection() in every method
where the database access occurs. Such a solution is too
costly and not in accordance with the suggestions
from Sun.
And finally, here are my questions: Why do I need to call
DataSource.getConnection() in every method accessing the
database when I use Weblogic? Is it a bug or a feature?
Does Entity Bean object in Weblogic loose the
java.sql.Connection when it changes the state
(READY -> POOLED -> READY)?
Mihal Badjonski <m...@datenknecht.de> wrote:
--
Dimitri