aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes creating record using ejb gives error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "creating record using ejb gives error" Watch "creating record using ejb gives error" New topic
Author

creating record using ejb gives error

Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

Hi all,

I get DuplicateKeyException exception whenever i try to insert record using EJB. Although i checked the value of primary key. They all are seems to be fine. I am giving you snapshot of error message.

Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

code for insert

amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 515
Hi,
Not very sure of the scenario in which you are using report_master table but check if the report_id that is returned is the next valid value and not the maximum value in that table. Your function name is findMax() which makes me think so.
If it is the max value then you will need to increment it to get next value.

Regds,
amit
Jagdeep Sharma
Ranch Hand

Joined: May 24, 2010
Posts: 121

amit punekar wrote:Hi,
Not very sure of the scenario in which you are using report_master table but check if the report_id that is returned is the next valid value and not the maximum value in that table. Your function name is findMax() which makes me think so.
If it is the max value then you will need to increment it to get next value.

Regds,
amit






Hi Amit,

I checked it. Both next value comes from findmax and 'select max(report_id) from report_master' are same.
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 515
Hi,
Can you please share the table details for "format" and "report_master" ? what are the primary keys there?
That might give some clue.

regards,
Amit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating record using ejb gives error