aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes WHAT HAPPENS IF FINDER METHD IN CMP BEANS HAVE AN INVALID ENTRY Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "WHAT HAPPENS IF FINDER METHD IN CMP BEANS HAVE AN INVALID ENTRY" Watch "WHAT HAPPENS IF FINDER METHD IN CMP BEANS HAVE AN INVALID ENTRY" New topic
Author

WHAT HAPPENS IF FINDER METHD IN CMP BEANS HAVE AN INVALID ENTRY

Sharad Naithani
Greenhorn

Joined: May 17, 2001
Posts: 3
HI
A PROBLEM IS CROPING UP.. I M USING FINDBYPRIMARYKEY METHOD IN CMP BEANS...NOW WHEN A INVALID ENTRY IS GIVEN THAT IS NOT PRESENT IN THE DATABASE IT GIVES AN EXCEPTION OF OBJECT NOT FOUND.....WELL BUT WHY IS IT SO THAT AFTER WARDS WHEN I GIVE A RIGHT ENTRY IT'S AGAIN GIVING AN EXCEPTION
REGARDS
Venkataramu Pendiyala
Greenhorn

Joined: May 16, 2001
Posts: 25
If the in the database commit command is not given and you invoke findByXXX() methods ObjectNotFoundException is thrown.
i,e.
1. Table is created
2. record is inserted.
3. commit
in this case ObjectNotFoundException will not be thrown.
If step 3 is avoided then ObjectNotFoundException is thrown.

SCJP
Sharad Naithani
Greenhorn

Joined: May 17, 2001
Posts: 3
Originally posted by Venkataramu Pendiyala:
If the in the database commit command is not given and you invoke findByXXX() methods ObjectNotFoundException is thrown.
i,e.
1. Table is created
2. record is inserted.
3. commit
in this case ObjectNotFoundException will not be thrown.
If step 3 is avoided then ObjectNotFoundException is thrown.

Hi
what do u mean by giving a commit command...pls specify....
actually my problem is in my database i have 1 entry for id=31125

1>so in findbyprimarykey(int id) if i give id=31125...it fecthes me the record details
2>now if i give id=as 31126 any wrong entry..it throws an exception of objectnotfound coz there is no record as such....
3>but again if i give id=31125..this time it doesn't work some sqlpersistence excpetion is there
what to do please help>>>

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: WHAT HAPPENS IF FINDER METHD IN CMP BEANS HAVE AN INVALID ENTRY
 
Similar Threads
ejb with weblogic6.0 & VAG3.0
About EJBs
Problem porting application from weblogic 6.1
EJB - Message error
How do we update relationship data using CMP model entity bean ??