Hi, pls help me. For example: I have 2 processes. When Proces1 have WSDLs1, WSDLs2 WSDLs3 and process2 WSDLs4 WSDLs5 WSDLs6, deleting process1 is OK. But, when process1 : WSDLs1 WSDLs2 WSDLs3 and proces2: !! WSDLs3 !! WSDLs4 WSDLs5 and i want deleting process1, recieve error :(( Pls help me.Thnx.
update and save works ok.
Sorry for bad english ;)
Mapping documents:<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="bexee"> <class name="BPELProcess" table="TableBPELProcess"> <id name="ProcessName" column="PNAME" type="string"> <generator class="assigned"/> </id> <property name="BPEL" type="string" not-null="true"></property> <property name="WSDL" type="string" not-null="true"></property> <property name="Status" type="string"></property> <set name="WSDLSet" table="P_W" cascade="all,delete-orphan"> <key column="PNAME"></key> <many-to-many column="PWSDL" class="WSDLs"></many-to-many>
</set>
</class> </hibernate-mapping>
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="bexee"> <class name="WSDLs"> <id name="PartnerWSDL" column="PWSDL" type="string"> <generator class="assigned" /> </id> </class> </hibernate-mapping>
Code between sessionFactory.openSession() and session.close():package bexee;
import org.hibernate.Session; import util.HibernateUtil;;
public class Test {
public static void main(String[] args) { Test Testik = new Test(); Testik.TestWSDL(); HibernateUtil.getSessionFactory().close(); } private void TestWSDL(){ Session session = HibernateUtil.getSessionFactory().openSession(); org.hibernate.Transaction tx = session.beginTransaction(); BPELProcess process = new BPELProcess(); session.load(process, "lukasko"); session.delete(process); session.flush(); tx.commit(); } }
Full stack trace of any exception that occurs:Hibernate: select bpelproces0_.PNAME as PNAME0_, bpelproces0_.BPEL as BPEL0_0_, bpelproces0_.WSDL as WSDL0_0_, bpelproces0_.Status as Status0_0_ from TableBPELProcess bpelproces0_ where bpelproces0_.PNAME=? Hibernate: select wsdlset0_.PNAME as PNAME__, wsdlset0_.PWSDL as PWSDL__, wsdls1_.PWSDL as PWSDL0_ from P_W wsdlset0_ inner join WSDLs wsdls1_ on wsdlset0_.PWSDL=wsdls1_.PWSDL where wsdlset0_.PNAME=?
Hibernate: delete from P_W where PNAME=? Hibernate: delete from WSDLs where PWSDL=? Hibernate: delete from WSDLs where PWSDL=? Hibernate: delete from WSDLs where PWSDL=?
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92) at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:161) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:71) at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:66) at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:130) at org.hibernate.persister.entity.BasicEntityPersister.delete(BasicEntityPersister.java:2019) at org.hibernate.persister.entity.BasicEntityPersister.delete(BasicEntityPersister.java:2184) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:59) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669) at bexee.Test.CreateAndStorePartnerWSDL(Test.java:25) at bexee.Test.main(Test.java:12) Caused by: java.sql.BatchUpdateException: failed batch at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:154) ... 14 more Exception in thread "main"
Name and version of the database you are using:hsqldb
|