Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Delete Build Definition via API

Hi,

I created a postop workitem save extension (server-side) that deletes a Build Definition item.
To do this I use the internal ITeamBuildService.

ITeamBuildService buildService = getService(ITeamBuildService.class);

...
buildService.delete(buildDefinition);



And I obtain an IllegalStateException exception:

Quote:

java.lang.IllegalStateException: Illegal transaction in progress for service method call.
at com.ibm.team.repository.service.internal.TransactionService.checkValidTransaction(TransactionService.java:83)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)



Any idea?

Thanks,
Andrea
_________________
Andrea Gabrielli

Nexen
Business Consultant

0 votes



3 answers

Permanent link
It's most likely due to the delete wanting to start a write transaction when an outer read transaction has already been started. That's puzzling, though, because as far as I know the operation participants (i.e. your extension) run in the same write transaction as the original operation (i.e. the work item save), so doing another write transaction within that should work OK.

0 votes


Permanent link
 Was anybody ever able to get this working? We're hitting the same issue doing basically the same use case that Andrea described. Could it have to do with it being done from an Event Handle? 

0 votes


Permanent link
We got the same exception trying to query from an event handler the build requests in queue:
	java.lang.IllegalStateException: Illegal transaction in progress for service method call.
	at com.ibm.team.repository.service.internal.PrimitiveTransactionService.checkValidTransaction(PrimitiveTransactionService.java:86)
	at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy159.checkValidTransaction(Unknown Source)
	at com.ibm.team.repository.service.AbstractService.checkValidTransaction(AbstractService.java:234)
	at com.ibm.team.build.internal.service.TeamBuildService.getQueryPageForBuildResultsFromBuildQueryCriteria(TeamBuildService.java:2230)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy1040.getQueryPageForBuildResultsFromBuildQueryCriteria(Unknown Source)
	at it.secservizi.rtc.open.server.event.stateChanged.BuildLaunch.waitPendingBuilds(BuildLaunch.java:611)
	at it.secservizi.rtc.open.server.event.stateChanged.BuildLaunch.retrieveLastBuildResult(BuildLaunch.java:565)
	at it.secservizi.rtc.open.server.event.stateChanged.BuildLaunch.handleEvent(BuildLaunch.java:505)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy1258.handleEvent(Unknown Source)
	at com.ibm.team.process.internal.service.ServerProcess.handleChangeEvent(ServerProcess.java:494)
	at com.ibm.team.process.internal.service.ProcessService$13.run(ProcessService.java:4642)
	at com.ibm.team.repository.service.internal.PrimitiveTransactionService$3.run(PrimitiveTransactionService.java:163)
	at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runTransaction(RepositoryDatabase.java:347)
	at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runInTransaction(RepositoryDatabase.java:271)
	at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:96)
	at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:91)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy159.runInTransaction(Unknown Source)
	at com.ibm.team.repository.service.internal.TransactionService.runInTransaction(TransactionService.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy823.runInTransaction(Unknown Source)
	at com.ibm.team.process.internal.service.ProcessService.runInTransaction(ProcessService.java:4786)
	at com.ibm.team.process.internal.service.ProcessService.doProcessChangeEvent(ProcessService.java:4638)
	at com.ibm.team.process.internal.service.ProcessService.doProcessChangeEvents(ProcessService.java:4574)
	at com.ibm.team.process.internal.service.ProcessService$12.run(ProcessService.java:4527)
	at com.ibm.team.repository.service.internal.PrimitiveTransactionService$3.run(PrimitiveTransactionService.java:163)
	at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase$Transaction.run(RepositoryDatabase.java:496)
	at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase$1.run(RepositoryDatabase.java:320)
	at com.ibm.team.repository.service.internal.rdb.ConnectionPoolService.withCurrentConnection(ConnectionPoolService.java:448)
	at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy121.withCurrentConnection(Unknown Source)
	at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runTransaction(RepositoryDatabase.java:316)
	at com.ibm.team.repository.service.internal.rdb.RepositoryDatabase.runInTransaction(RepositoryDatabase.java:271)
	at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:96)
	at com.ibm.team.repository.service.internal.PrimitiveTransactionService.runInTransaction(PrimitiveTransactionService.java:91)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy159.runInTransaction(Unknown Source)
	at com.ibm.team.repository.service.internal.TransactionService.runInTransaction(TransactionService.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy823.runInTransaction(Unknown Source)
	at com.ibm.team.process.internal.service.ProcessService.runInTransaction(ProcessService.java:4786)
	at com.ibm.team.process.internal.service.ProcessService.processChangeEvents(ProcessService.java:4525)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy1025.processChangeEvents(Unknown Source)
	at com.ibm.team.process.internal.service.ProcessChangeEventsTask.runTask(ProcessChangeEventsTask.java:36)
	at com.ibm.team.repository.service.async.AbstractAutoScheduledTask.executeTask(AbstractAutoScheduledTask.java:92)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
	at java.lang.reflect.Method.invoke(Method.java:611)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)
	at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
	at com.sun.proxy.$Proxy1028.executeTask(Unknown Source)
	at com.ibm.team.repository.service.internal.scheduler.AsynchronousTaskRunner.runTask(AsynchronousTaskRunner.java:158)
	at com.ibm.team.repository.service.internal.scheduler.AsynchronousTaskRunner.run(AsynchronousTaskRunner.java:119)
	at java.lang.Thread.run(Thread.java:761)
It's most likely due to the delete wanting to start a write transaction when an outer read transaction has already been started. 
In our case, why should it be blocked if we started a read transaction (and not a write one)?
Thanks in advance.

0 votes

Comments

We resolved using a IBuildResultQueryModel instance.

Cheers.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927
× 562

Question asked: Jun 14 '11, 12:42 p.m.

Question was seen: 6,722 times

Last updated: Jul 26 '16, 12:06 p.m.

Confirmation Cancel Confirm