1 Reply Latest reply on Oct 18, 2006 3:57 AM by fhh

    Help on javax.persistence.NonUniqueResultException

    scout1lacno

      Hi all,

      Im developing and EJB 3.0 application with JBOSS 4.0.4.GA and NB 5.5. Im having an error below:


      2006-10-18 14:11:08,690 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/CRM-war].[PlaceBean]] Servlet.service() for servlet PlaceBean threw exception
      javax.ejb.EJBException: javax.persistence.NonUniqueResultException: org.hibernate.NonUniqueResultException: query did not return a unique result: 161
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)


      The entity:

      @Entity
      @Table(name = "tblCountry")
      public class TblCountry implements Serializable {
      
       @Id
       @Column(name = "IDCountry", nullable = false)
       private Integer iDCountry;
      
       @Column(name = "strCountry", nullable = false)
       private String strCountry;
      
       @Column(name = "strRegion")
       private String strRegion;


      Does anyone has an idea about this error? A link?

      Hope for a kind reply

      Thankz :)

        • 1. Re: Help on javax.persistence.NonUniqueResultException

          From the Java EE 5 documentation:


          Thrown by the persistence provider when getSingleResult() is executed on a query and there is more than one result from the query. This exception will not cause the current transaction, if one is active, to be marked for roll back.


          Regards

          fhh