473,322 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Serializing EJB Parameters in Weblogic

I have been using Weblogic 5.1 for a couple of years. I currently
pass an object as a parameter to my ejbCreate method. The data in the
object could be modified by my bean and the caller needs to see these
changes. This worked fine in 5.1, but it does not work since I have
upgraded to Weblogic 7.0. The changes to the object passed as a
parameter does not make it back to the caller on the remote interface.
I assume the object is not being serialized back to the client. Does
anyone know why this behavior has changed and is there a way I can
indicate to the ejb container that I want these parameters serialized
back?
Jul 17 '05 #1
1 3823
Ma************@insightbb.com (Martin Zeigler) wrote:
I have been using Weblogic 5.1 for a couple of years. I currently
pass an object as a parameter to my ejbCreate method. The data in the
object could be modified by my bean and the caller needs to see these
changes. This worked fine in 5.1, but it does not work since I have
upgraded to Weblogic 7.0. The changes to the object passed as a
parameter does not make it back to the caller on the remote interface.
I assume the object is not being serialized back to the client. Does
anyone know why this behavior has changed and is there a way I can
indicate to the ejb container that I want these parameters serialized
back?


There is no "serialized back" in EJB. I haven't tried what you're
doing, but it definitely should NOT work. I would speculate that what
you are seeing is a bug in WebLogic 5.1, associated with their
optimization of "local calls to Remote Interfaces". They probably gave
your bean the reference to the actual object, which is expressly
forbidden by section 18.2.3 of the EJB 1.1 Specification:
"Specifically, the EJB Container is not allowed to pass
non-remote objects by reference on inter-EJB invocations
when the calling and called enterprise beans are collocated
in the same JVM. Doing so could result in the multiple beans
sharing the state of a Java object, which would break the
enterprise bean's semantics."
(In the EJB 2.0 Specification, this requirement is in section 24.2.7).

Fortunately for you, there is an easy solution: change your bean to
use a Local Interface instead of a Remote Interface (and of course,
LocalHome instead of Home Interface). This will allow the arguments to
be passed by reference*:
"An enterprise bean's local home and local interfaces are
local Java interfaces. The caller and callee enterprise
beans that make use of these local interfaces are typically
collocated in the same JVM. The EJB Container must ensure
the semantics for passing arguments across these interfaces
conforms to the standard argument passing semantics of the
Java programming language." -- EJB 2.0 Spec, Section 24.2.7

Editorial: A much better solution would be not to modify parameters,
as that is quite unexpected behavior for EJBs. An even better solution
would be not to use stateful beans at all, and rely entirely on
stateless session beans and message-driven beans.

As an aside, you probably would have gotten a better response on
comp.lang.java.beans. This newsgroup (comp.lang.java) is not an
"official" newsgroup, and thus does not reach many sites outside of
Google Groups. The worldwide Java newsgroups are:

comp.lang.java.3d 3D Graphics API's for the Java language
comp.lang.java.advocacy Support for and criticism of the Java System
comp.lang.java.announce Announcements re the Java System (Moderated)
comp.lang.java.beans Java software components (JavaBeans)
comp.lang.java.corba Topics relating to Java and CORBA
comp.lang.java.databases Databases, java.sql, JDBC, ODBC
comp.lang.java.gui GUI toolkits and windowing: AWT, IFC etc
comp.lang.java.help Set-up problems, catch-all first aid
comp.lang.java.machine JVM, native methods, hardware
comp.lang.java.programmer Programming in the Java language
comp.lang.java.security Security issues raised by Java
comp.lang.java.softwaretools IDEs, browsers, compilers, other tools

* for the "Java doesn't pass by reference" crowd: I know that. But you
will note that the EJB Specification uses the term "pass by
reference", and doing so makes it more obvious what is being
discussed. The distinction between "passing objects by reference" and
"passing references by value" just isn't important to this particular
discussion, mm-kay?
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Benny | last post by:
Hi i am using fop to generate dynamical pdf documents from a servlet, in weblogic 5.1. Fop works very fine but i need to generate barcodes in my documents so i am integrating it with krysalis...
0
by: Per-Christian Engdal | last post by:
Hi, I have built a cocoon.war file, and deployed it on my BEA Weblogic 8.1 Sp2 (Windows 2000) installation. The deployment works without exceptions, but when I try to access cocoon through...
4
by: Accolo1 | last post by:
Help we are looking for this person, do you know them? William wjohnson@accolo.com Title: BEA WebLogic Portal Guru Job #: 03-04468 Check the pulse of your career! Evolve our eCommerce web...
1
by: WebServiceSecurity | last post by:
The issue involves the following technologies: - 1. .NET 2.0 Framework 2. WSE2.0 (WS-Security) 3. X.509 certificates 4. BEA Weblogic 8.1.5
0
by: manauwaralam | last post by:
javax.naming.NameNotFoundException: While trying to lookup 'weblogic.jdbc.jts.vdmsPool' didn't find subcontext 'jdbc' Resolved weblogic; remaining name 'jdbc/jts/vdmsPool' at...
2
by: QTR | last post by:
Hello, I discovered a strange XSLT behaviour on Weblo 8.1. Let me explain it (see at the end my example XSLT): I call a template (1) with one parameter (A) which calls another template (2) with...
5
by: swebster | last post by:
Can someone explain the differences between setting cookies on TomCat or a Weblogic webserver? I discovered today during a deployment to Weblogic that a cookie can be set and retrieved in a...
1
by: dynamic4mayank | last post by:
Hi, I have the setup as follows: weblogic server 7 service pack 2, sybase 12.5 database, and java 1.4.3 Can anyone tell me which other jar can be used instead of weblogic.jar to connect to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.