on 07-28-2009 7:08 AM
I have two table. One is the master table and other one is relational table, that has foreign key , that is the primary key of Master Table. While inserting the values in the corresponding relational table, the foreign key value is being flushed. I am setting the relational value in ejbPost Method. The exception is as follows:
com.sap.engine.services.ts.exceptions.BaseRollbackException: Exception in beforeCompletition of ( SAP J2EE Engine JTA Transaction : [05242660032ffffffe2] ).
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:236)
at com.indience.iub.core.LogicalSystemPropertyLocalHomeImpl0_0.createByBean(LogicalSystemPropertyLocalHomeImpl0_0.java:675)
at com.indience.iub.core.EntityOperationsBean.createLogicalSystemProperty(EntityOperationsBean.java:246)
at com.indience.iub.core.EntityOperationsLocalLocalObjectImpl0_0.createLogicalSystemProperty(EntityOperationsLocalLocalObjectImpl0_0.java:607)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: SQLException while the data is being flushed. The persistent object is com.indience.iub.core.LogicalSystemPropertyBean0_0Persistent.
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:101)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flushAll(TransactionContext.java:429)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.flush(TransactionContext.java:378)
at com.sap.engine.services.ejb.entity.pm.TransactionContext.beforeCompletion(TransactionContext.java:506)
at com.sap.engine.services.ejb.entity.SynchronizationList.beforeCompletion(SynchronizationList.java:136)
at com.sap.engine.services.ts.jta.impl.TransactionImpl.commit(TransactionImpl.java:226)
... 28 more
Caused by: com.sap.sql.log.OpenSQLException: Cannot assign NULL to host variable 2. setNull() can only be used if the corresponding column is nullable. The statement is "insert into IUB_SYS_PROPS (UID, SYS_NAME, PROP_VAL, PROP_NAME) values (?, ?, ?, ?)".
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:85)
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Syslog.java:124)
at com.sap.sql.jdbc.common.CommonPreparedStatement.setNull(CommonPreparedStatement.java:299)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.setNull(PreparedStatementWrapper.java:397)
at com.indience.iub.core.LogicalSystemPropertyBean0_0Persistent.ejb_iInsert(LogicalSystemPropertyBean0_0Persistent.java:381)
at com.sap.engine.services.ejb.entity.pm.UpdatablePersistent.ejbFlush(UpdatablePersistent.java:92)
... 33 more
it was solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how did ur error got solved?
can u plz share it?
as i am getting d same error
com.sap.sql.log.OpenSQLException: Failed to set the parameter 8 of the statement >>INSERT INTO "BAP_TRN_BR_PLMNT" ("PLMNTDISC_ID","MOD_BY","PLMNTDISC_URN","CREAT_BY","MOD_DT","CREAT_DT","VERSION","DISC_STS","ORG_ID") VALUES (?,?,?,?,?,?,?,?,?)<<: Cannot assign NULL.
plz rply asap as i hv 2 submit my assignment by 2mrw mrng
My Problem is still not solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manoj
>Cannot assign NULL to host variable 2. setNull() can only be used if the corresponding column is nullable. The statement is "insert into IUB_SYS_PROPS (UID, SYS_NAME, PROP_VAL, PROP_NAME) values (?, ?, ?, ?)"
Check what you are assigning for SYS_NAME. It must not be NULL according to the table declaration.
BR, Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually what is happening that i am setting the SYS_NAME value in ejbPost Method. Using the setMethod. When i debugged then i found that i have a values of SYS_NAME at that time. But before committing the values into the tables, the SYS_NAME values is being flushed. That why the the cannot assign null error is coming.
So I want to resolve my flushhing problem.
User | Count |
---|---|
80 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.