Someone from this discussion group indicate that container might cache the
PreparedStatement.

Could someone talk about the PreparedStatement lifecycle in the JBOSS EJB
Container? I beleieve that will help us to understand the usage of the
PreparedStatement in the EJB environment.

- Mike Jau 

-----Original Message-----
From: Jeff Markham [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 5:53 AM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] A little BMP philosophy/understanding


I don't believe I quite have an understanding of EJBs as most of the people
on this list so I'd like to ask a couple questions on BMP EJB design
best-practices.

In all the examples I've ever seen of BMPs, every persistence and finder
method both 1) finds a DataSource and gets a Connection from it and 2)
instantiates a PreparedStatement.

Before looking into EJBs, I just went to the database from a servlet via
JDBC.  In the servlet, I would get a Connection and do all my
PreparedStatements in the init() method of the servlet.  On any requests
that required the services of any PreparedStatement, I'd synchronize
clearParameters and run it.

Couldn't this same concept be done in an BMP's setEntityContext() method?
Couldn't I get the Connection and do all the PreparedStatements there?  It
just seems that by doing a PreparedStatement in each call to the BMP's
persistence and finder methods, it defeats the purpose of a
PreparedStatement.

Just for kicks, I gave it a try but transactions weren't completed and
they'd just hang out there forever, blocking every other persistence and
finder method until they timed out.

Thoughts? Feedback?  Maybe I'm misunderstanding some fundamental EJB
concepts.  In any case, I'd like to know what the best practices are for
BMPs.  Thank you.


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to