Chris,
As you know beans developed for EJB 1.0 servers are not forward-compatible with
EJB 1.1 servers. In other words, beans developed for EJB 1.0 will not work in
EJB 1.1 servers. In your case you are going between JOnAS and Weblogic, but
the portability issues are the same: How do you create beans that work in
different versions or brands of server?
I have developed an abstraction called the PortableContext that address many of
the forward compatibility issues when porting beans from EJB 1.0 to EJB 1.1.
The PortableContext presents the bean developer with a single interface that
hides differences between EJB server versions including security, JDBC
connections (DataSource vs simple Connection), EJB references, and properties.
It can easily be extended to cover your UserTransaction problem (JTS vs JTA)
and already accommodates differences in how JDBC connections are obtained.
When the PortableContext is employed, the bean code does not need to change
when porting beans to a new server. The PortableContext will automatically
change its behavior to work in different EJB servers at runtime.
There is a two part article explaining this approach in detail that will be
published soon (days) in JavaWorld.
Richard
--
Richard Monson-Haefel
EJB Expert for jGuru.com
( http://www.jguru.com )
Author of Enterprise JavaBeans
Published by O'Reilly & Associates
( http://www.ejbnow.com )
chris humphrey wrote:
> Hi all,
>
> We are currently creating an ejb solution. It is in the works for buying
> a weblogic license, but we dont have it yet. Since we have to deliver
> very soon we built the ejb code using the jonas(bull) app server. We
> have been trying to keep any jonas code separate so it could be removed
> easily. We would really like to be able to switch between the app
> servers without changing code, classpath changes would be ok. We are
> wondering if anyone else has solved this problem and how they solved it.
>
> As I see it, there are 2 differences (at least in my java code so far)
> between weblogic and jonas.
> 1) transactions (can someone tell me which is the standard?)
> - jonas uses 'javax.transaction.UserTransaction'
> - weblogic uses 'javax.jts.UserTransaction'
>
> 2) DataSource,
> - jonas uses JNDI storing a 'javax.sql.DataSource' bound to the db
> pool name .
> - weblogic uses the environment to get to the connection pool.
>
> These are the differences I have come across so far in the dozen plus
> ejb's I have created so far using both environments for this
> application.
>
> One way we have thought to seperate them was to create an abstract
> transaction (and datasource) class. Then store the name in JNDI (or in
> the environment) do a class.forName on the object, and have a reference
> to the abstract class. Then the implementation for each would be
> seperate and we would have the different names in the environment. We
> could also bind the object in JNDI, which would do the same thing.
>
> We am interested in any ways some of you may have solved this problems,
> and any ideas anyone has to solve it.
>
> Thanks in advance
> Chris
>
> Qwest communications
>
> ===========================================================================
> 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".
===========================================================================
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".