cancel
Showing results for 
Search instead for 
Did you mean: 

Netweaver java program is not able to update the record checked out

Former Member
0 Kudos

There are many users working on MDM Data manager and they do modify the records in a workflow.

As there are many users working on the set of product records, exclusive lock on the record is required when workflow is triggered.

After the modifications are complete they trigger the java program to calculate few product measures based on modifications.

Java program will update the results back into the product record.

Java program is not able to update the record as the record is checked out by workflow.

Does any one can suggest me on how to execute database update from java program when the coresponding record is checked out by workflow?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Make sure the connection which Java API uses , the userid is always joined on the checkout.

Former Member
0 Kudos

we have to accept the workflow check out in exclusive lock mode.

can we have two users exclusively check out a record?

Former Member
0 Kudos

YES you can, make sure the Java API role has these Function(s) enabled in console for the role ( I hope you have a separate special role for the API trusted user)

"Modify Join permissions for non-owned records"

"Check in owned records"

"Check in non owned records"

"Modify checked out records"

Then you join the checkout, modify it and check in record.

Let us know ur success?

Edited by: Sudhir Reddy Maddulapally on Sep 19, 2008 3:55 AM

Former Member
0 Kudos

This resolved the issue. Now we are facing another issue. User who is in check out list of the workflow is not able to see hierarchial data of the master record.

I am trying to use another user session to fetch hierarchy information, but this didnot work out.

RetrieveRelationshipsCommand productHeirarchyRelationship = new RetrieveRelationshipsCommand(ConnectionAttributes.conaccessor);

productHeirarchyRelationship.setSession(ConnectionAttributes.NewSessionID);

productHeirarchyRelationship.setAnchorRecord(rec);

productHeirarchyRelationship.setAnchorRecordId(rec.getId());

productHeirarchyRelationship.setRelationshipId(RepositorySchemaForProduct.productRepositorySchema.getRelationshipId("Parent2"));

try {

productHeirarchyRelationship.execute();

} catch (CommandException e4) {

e4.printStackTrace();

}

RelationshipGroup productMembersGroup = productHeirarchyRelationship.getRelationshipGroup();

RecordId[] childIds = productMembersGroup.getMemberRecordIds();

Getting a NullPointer Exception at this point

Application error occurred during request processing.

Details: java.rmi.RemoteException:

com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception

in method com.kraft.auom.RelationshipToTreeObjectImpl0_0.getRecUpdPartial(java.util.List,java.util.List).

at com.kraft.auom.RelationshipToTreeObjectImpl0_0.getRecUpdPartial(RelationshipToTreeObjectImpl0_0.java:416)

at com.kraft.auom.RelationshipToTree_Stub.getRecUpdPartial(RelationshipToTree_Stub.java:415)

at com.kraft.AuomCalculation.doGet(AuomCalculation.java:169)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)

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: java.lang.NullPointerException

at com.kraft.lib.RelationshipChildren.getChildren(RelationshipChildren.java:53)

at com.kraft.auom.RelationshipToTreeBean.getRecUpdPartial(RelationshipToTreeBean.java:288)

at com.kraft.auom.RelationshipToTreeObjectImpl0_0.getRecUpdPartial(RelationshipToTreeObjectImpl0_0.java:407)

... 20 more

; nested exception is:

java.lang.NullPointerException

Exception id: [00144F54B441007A000000E1000015F8000457ABDEDF5C34]

Answers (2)

Answers (2)

Former Member
0 Kudos

When a record is checked out exclusively, MDM maintains two copies of the record.

Original record is protected and duplicated record is available for check out users for modifications.

Relationship (self) defined on this table is visible only for original record not for the duplicate records.

becuase record ids of the original and duplicate record are different.

Resolution: Fetch original record using duplicate record id to get relationship information. Use duplicate record id for updations and to get latest information.

Former Member
0 Kudos

I am still getting the exception if record is in workflow.

com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: The record is protected

I can see the workflow admin in workflow list if I open Modify Join permissions window. but workflow admin user is in grey color in the list.

workflow admin user is being used from java program in ModifyRecordsCommand