Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

EJB session bean design questions
I'm building my first complicated EJB application and I've hit a problem to
do with declarative transaction settings. It's a subject that to date I've
been able to ignore - now I'm hoping somebody can help me with some general
guidance.  I'm using the facade pattern where a stateless session bean masks
access to underlying CMP entity beans.

One of my more important session bean methods is a lengthy process that
involves multiple steps, each step will itself call one or more other
stateless session beans. Most of the calls to other stateless session beans
are to retrieve information, like 'getEntityX', 'findAllEntityY'.

Occasionally one of these retrieval calls will fail, (the underlying entity
may not exist). This is perculating up as a exception which triggers a
transaction roll back error in the main process, which is not what I want.
So it seems that I have to declare the transaction settings for each of the
retrieval related methods to avoid yes, right?

These leads to two general design questions on stateless session beans that
act as facades...

a). How to handle data not found situations.
If I have a session bean method like....

public EmployeeVO findEmployee(String anEmployeeCode);

... what should the method return if the employee does not exist. Should I
allow a EJBException to be thrown, or should the session bean method capture
the exception and return a null value object result. Both methods are
possible, I'm just wondering what is the more popular?

b). Declarative transactions for session bean methods
Should I by default make all session bean retrieval related methods have a
'not supported' transaction setting?




Report this thread to moderator Post Follow-up to this message
Old Post
davout
12-08-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Beans archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:17 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.