Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Finder query return type..?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a session bean ProcessBean and an entity bean AlarmBean....
where one of functions processor() of ProcessDataBean is like......
processor()
{
println(.a..);
println(..b.);
correlate();
println(.c..);
}
And correlator() is like:-
correlator()
{
println(..d.);
AlarmBeanLocal l = finder query();
println(.e..);
if(l != null)
{
println(.m..)
}
else
{
println(.n..)
}
}
Finder query returns the reference to the entity bean's local interface.......and depending on whether find is successful or not....I've to print m or n....
Now the problem is whenever find is successful.......e, then m and then c gets printed......
but when finder query is not successful, e and n doesn't get printed....and directly c gets printed...it means finder query is directly returning control to the previous function(processor where c is getting printed) .......
I'm not getting whr. is the problem....
in the condition l != null......?
Plz. help me out...
All the declarations in local and home interfaces and ejb-jar is correct.......and my jar file is deployed successfully.....but the output is not correct.....
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finder methods should throw a FinderException for single entity finders if the object is not found.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by swati jain:

surround
AlarmBeanLocal l = finder query();
with try - catch construct and catch FinderException

 
    Bookmark Topic Watch Topic
  • New Topic