Announcement Announcement Module
Collapse
No announcement yet.
org.springframework.jdbc.UncategorizedSQLException: Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.springframework.jdbc.UncategorizedSQLException:

    Hi all,


    this is the code I am using
    ________________________

    Template te=(Template)getHibernateTemplate().load(Template. class, templateOID);
    BOMElemDefn bed= (BOMElemDefn)getHibernateTemplate().load(BOMElemDe fn.class,bomelemdefnOID);
    FormTag ft= (FormTag)getHibernateTemplate().load(FormTag.class ,formtagOID);
    System.out.println("*******entered addFormTags()*****");


    if( !ft.getBomElems().contains(bed) ){
    System.out.println("*******contains*****");
    ft.getBomElems().add(bed);
    getHibernateTemplate().saveOrUpdate(ft);
    te.getFormTags().add(ft);
    getHibernateTemplate().saveOrUpdate(te);
    getHibernateTemplate().clear();
    }


    this is the mapping I am using
    _________________________________

    <class name="BOMElemDefn" table="BOMElem_Defn">
    <id name="oid" type="java.lang.Long" column="oid">
    <generator class="sequence">
    <param name="sequence">BOMElem_Defn_Seq</param>
    </generator>
    </id>

    <!-- Entity attributes -->
    <property name="name" type="java.lang.String"/>
    <property name="displayname" type="java.lang.String"/>
    <property name="isgroup" type="boolean"/>
    <!-- Entity attributes -->

    <!-- Relationships -->
    <many-to-one name="parent" class="vz.esm.edm.pom.BOMElemDefn" column ="parentOid"/>
    <set name="childElems" lazy="false">
    <key column="parentOid"/>
    <one-to-many class="vz.esm.edm.pom.BOMElemDefn"/>
    </set>

    <set name="formTags" table="BOMElemDefn_FormTag_MM" inverse="true" lazy="false" >
    <key column="BOMElem_DefnOid"/>
    <many-to-many column="FormTagOid" class="vz.esm.edm.pom.FormTag"/>
    </set>

    </class>



    this is the other mapping
    ___________________________
    <class name="FormTag" table="FormTag">
    <id name="oid" type="java.lang.Long" column="oid">
    <generator class="sequence">
    <param name="sequence">FormTag_Seq</param>
    </generator>
    </id>

    <!-- Entity attributes -->
    <property name="name" type="java.lang.String"/>
    <property name="isgroup" type="boolean"/>

    <!-- Relationships -->
    <many-to-one name="parent" class="vz.esm.edm.pom.FormTag" column ="parentOid"/>
    <set name="childTags" lazy="false">
    <key column="parentOid"/>
    <one-to-many class="vz.esm.edm.pom.FormTag"/>
    </set>

    <set name="SystemTags" table="Formtag_SystemTag_MM" lazy="false">
    <key column="FormtagOid"/>
    <many-to-many column="SystemTagOid" class="SystemTag"/>
    </set>

    <set name="bomElems" table="BOMElemDefn_FormTag_MM" inverse="false" lazy="false">
    <key column="FormTagOid"/>
    <many-to-many column="BOMElem_DefnOid" class="vz.esm.edm.pom.BOMElemDefn"/>
    </set>

    <!-- Relationships -->

    </class>

    this is the error I get
    _______________________

    *******entered addFormTags()*****
    *******contains*****
    Hibernate: update FormTag set name=?, isgroup=?, parentOid=? where oid=?
    Hibernate: insert into BOMElemDefn_FormTag_MM (FormTagOid, BOMElem_DefnOid) valu
    es (?, ?)
    14:10:20,704 ERROR [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] ne
    t.sf.hibernate.util.JDBCExceptionReporter - failed batch
    14:10:20,714 ERROR [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] ne
    t.sf.hibernate.util.JDBCExceptionReporter - failed batch
    14:10:20,724 ERROR [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] ne
    t.sf.hibernate.impl.SessionImpl - Could not synchronize database state with sess
    ion
    14:10:20,764 ERROR [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] co
    m.sun.faces.lifecycle.InvokeApplicationPhase - #{pc_MapDocumentSearch.doSearch}:
    javax.faces.el.EvaluationException: org.springframework.jdbc.UncategorizedSQLEx
    ception: (Hibernate operation): encountered SQLException [failed batch]; nested
    exception is java.sql.BatchUpdateException: failed batch
    javax.faces.FacesException: #{pc_MapDocumentSearch.doSearch}: javax.faces.el.Eva
    luationException: org.springframework.jdbc.UncategorizedSQLException : (Hibernate
    operation): encountered SQLException [failed batch]; nested exception is java.s
    ql.BatchUpdateException: failed batch
    at com.sun.faces.application.ActionListenerImpl.proce ssAction(Ljavax.fac
    es.event.ActionEventV(ActionListenerImpl.java:78)
    at javax.faces.component.UICommand.broadcast(Ljavax.f aces.event.FacesEve
    ntV(UICommand.java:312)
    at javax.faces.component.UIViewRoot.broadcastEvents(L javax.faces.context
    .FacesContext;Ljavax.faces.event.PhaseIdV(UIViewRoot.java:302)
    at javax.faces.component.UIViewRoot.processApplicatio n(Ljavax.faces.cont
    ext.FacesContextV(UIViewRoot.java:416)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.exe cute(Ljavax.faces.c
    ontext.FacesContextV(InvokeApplicationPhase.java:75)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(Ljavax .faces.event.PhaseI
    d;Lcom.sun.faces.lifecycle.Phase;Ljavax.faces.cont ext.FacesContextV(LifecycleI
    mpl.java:200)


    the first i am able to insert into the database, but if I try to insert the same object , it gives the above error, please advice.


    thanks
    Pradeep
Working...
X