This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Java Products and Servers and the fly likes Problem on Resin CMP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Problem on Resin CMP" Watch "Problem on Resin CMP" New topic

Problem on Resin CMP

Frank Hung

Joined: Mar 11, 2004
Posts: 1
I encounter some problems while using resin CMP.
I find that when I get a object and update the value of attribute, resin don't really update it, instead it produce a new record
This violate the primary key constraint of my database so error occurs:
Exception while try to update invoice: com.caucho.ejb.EJBExceptionWrapper: com.caucho.transaction.RollbackExceptionWrapper: com.caucho.ejb.EJBExceptionWrapper: com.sybase.jdbc2.jdbc.SybSQLException: Attempt to insert duplicate key row in object 'invoice_items' with unique index 'invoice_it_14011080821'

My method of update data is simple, it is just the following codes:
myInvoiceItem = invoiceItemHome.findByJobNumberAndTarget(invoice_jobNo, invoice_target);

InvoiceItem findByJobNumberAndTarget(String job_number, String target)
throws FinderException;

SELECT o FROM invoiceItems o
AND UPPER(o.invoiceTarget) LIKE UPPER(?2)

I really don't know what is the problem. Can anyone help me?
jQuery in Action, 2nd edition
subject: Problem on Resin CMP
Similar Threads
Please help me on using EJB-QL with JBoss 4.0
Null Pointer exception thrown while deploying the cmp bean
ejb2.x finder method not working
EJB-QL help
need help in EJB QL with upper and like