Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Major difficulty understanding what's wrong with CAPI.Exec()
Robert_Davies_(unlondonadmin_-_(deleted))
Hi folks.I really do hope someone can help me with this since it is baffling me.The sequence of steps are:1. Open a transaction2. Select all rows from DREADLIST for this user & discussion (there should only be one row)3. Send a delete request (returns 1 indicating one row affected, i.e. deleted?)4. Commit the transaction (Use CAPI.COMMIT to ensure it is committed, no error)5. Re-select, i.e. step 2 (still has 1 row in the database)By 5. the delete instruction has failed!Can anyone explain this?I have attached the code of my function, it is largely a copy of ReadListPut in Discussion:DiscussionRoot:TopicPkg, with a few mods.Below is the debug output when the function is run:1. Starting deletion procedure, what's in the database?V{<'USERID','OWNERID','READLIST'><1000,2197,'{{1,1}}'>}2. Deleting whats there.3. Committing the transaction4. After transaction has been committedV{<'USERID','OWNERID','READLIST'><1000,2197,'{{1,1}}'>}303906 Func='ll.2198.MarkUnread' Timing: . 0The result of the delete query is 1 row with according to the CAPI.Exec() documentation means 1 row was deleted. So the database should now be empty. But it's not.The blank line between 3 and 4 is the error message being printed after the call to CAPI.EndTransaction(). Since it's blank I assume there is no error (and no error is caught.)*Please* can someone help me, I just don't seem to see why this isn't working...Best regards/matt.
Find more posts tagged with
Comments
Robert_Davies_(unlondonadmin_-_(deleted))
On a hunch I commented out all code relating to the transaction being opened and committed. Now whilst KSql complains about me updating with a transcation open something different happens.Now in step4 of the output the deleted row does not appear in the query. It looks as if it worked. However when I go back to the database using Oracle SQL worksheet I find the deleted row still exists!What is going on? Is this because the SQL client is caching rows? Is Livelink?Why on earth don't I seem to be able to delete?Best regards/Matt
Robert_Davies_(unlondonadmin_-_(deleted))
I could have kicked myself when I realised what was wrong. To cut a long story short:My MarkUnread handler deletes the message number from the readlist, then returns the browser view to the message. Of course I had forgotten that in doing so it re-ammends the readlist with the message number.Net result it looked like nothing had happened!I still haven't figured out the deal with the "Transaction not committed" messages but hopefully those were a result of something I was doing in trying to track down my phantom DAPI/CAPI problem.Mea culpa!Best regards/matt.
Mike_Oliver_(ollie_(Delete)_137504)
Transaction Not Committed usually occurs when you are using the debugger and quite or can't continue, leaving the transaction open, restarting the builder will clear the transaction.