# Why does MAAPI suspend in read() function?

**URL:** <https://dmap-community.ductus.global/t/why-does-maapi-suspend-in-read-function/408>\
**Category:** CDB and CDB API\
**Created:** [March 8, 2016, 8:57am UTC](https://dmap-community.ductus.global/t/why-does-maapi-suspend-in-read-function/408 "2016-03-08T08:57:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [March 8, 2016, 5:43pm UTC](https://dmap-community.ductus.global/t/why-does-maapi-suspend-in-read-function/408/2 "2016-03-08T17:43:22Z")

</div>

Hi Lynn,

Note that if you do a MAAPI call like maapi\_apply\_trans() from a the same thread that also is a CDB subscriber for the data you are committing through MAAPI, you will have a deadlock.

The deadlock occur since ConfD is notifying the subscribers and waiting for a CDB\_SYNC\_SUB CDB\_DONE\_PRIORITY, but your application thread cannot serve the CDB subscription event as it is busy waiting for the MAAPI transaction to complete when the subscriber is done. You have a deadlock.

Try performing the MAAPI call from a separate thread, i.e. not in the same context as your subscriber.

---

_[View the full topic](https://dmap-community.ductus.global/t/why-does-maapi-suspend-in-read-function/408)._
