• Post Reply Bookmark Topic Watch Topic
  • New Topic

StringBuffer as an EJB parameter  RSS feed

 
Ewandro Araujo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created an EJB using a StringBuffer parameter.
When I debug my app (using JBuilder and Weblogic 6.1) I can see my StringBuffer contents at the EJB/Server side but my StringBuffer variable at client side (when the method returns) has nothing inside.
Thanks for any help
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the client code? One thing to remember is that EJBs work in a pass-by-value way, not pass by reference. So, something like this client code:
StringBuffer foo = new StringBuffer();
myEJB.doSomethingWith(foo);
won't affect the value of foo at all -- that's because what is sent to the EJB is a copy of foo (due to the serialization and deserialization of the parameters).
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Ewandro Araujo
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.
Was exctly this problem...pass-by-value way.
Cheers
Ewandro
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!