| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: OAS 4.0 EJB - General questions
pl2java is a tool which generates Java classes to wrap PL/SQL procedures.
It was built to run only with JWeb. With OAS 4.X it is not safe to build
code for one cartridge environment which uses classes built for another.
The preferred tool for access to the database would probably be SQLJ which gives you eseentially a precompiler for JDBC.
OAS 4.X only support Session EJBs which are stateless. You might want to check the EJB spec to see what types of things the container can do to the beans while the client isn't looking. Not the least of these is that beans don't really live across clients, so static data isn't really useful. And yes, while you keep static stuff in JWeb for performance and session management, in EJB you get a reference to the EJB via the home interface and keep it until you are done with it so you don't need static variables for session state. Unfortunately you can't use them for performance either.
What you really want is a JDBC driver or classes which support connection pooling so the actual EJBs aren't worrying about keeping database connections open.
Paul wrote:
> Hello,
>
> I am learning about OAS 4.0, in particular Enterprise
> Java Beans. I have not had any experience with CORBA
> or any other type of serialized objects, and so would
> appreciate any advice in general to get me started making
> a test bean (even HOW to serialize my bean would be good
> for starters!).
>
> Specifically, I have two questions about the differences
> between the use of EJB and the JWeb cartridge:
>
> 1) The docs make it appear that pl2java is not applicable
> to EJB applications. Is this true? If so, is database
> access only available through JDBC, or....?? What about
> the other classes that Oracle provides for JWeb (rdbms,
> html, plsql, WRB, etc.)? If none of these are available in
> an EJB, what exactly is the usefulness of beans???
>
> 2) The developer's guide also seemed to warn against keeping
> static data elements in non-stateful beans, but was not very
> specific about why that would be a problem. Is using static
> elements as in the JWeb cartridge (to hold things you don't
> want to have to reinitialize every time a request is made like
> database sessions) a big no-no for EJB?
>
> Answers to these questions and any other advice anyone
> could offer me would be deeply appreciated!!!
>
> ++
>
> Since we have a week-long holiday in Japan, I won't be able
> to keep up with the usenet, thus Email responses would be
> sincerely appreciated!
>
> -- Paul
>
> ----- Posted via Deja.com, The People-Powered Information Exchange -----
> ------ http://www.deja.com/ Discussions * Ratings * Communities ------
Received on Fri Apr 30 1999 - 12:55:43 CDT
![]() |
![]() |