/*
* Backout the current unit of work for this QueueManager instance
*
* Since the last commit or rollback any messages put to a queue
* under synchpoint will be removed and any messages retrieved
* under synchpoint from any queues will be returned
*
* Note:
* * backout will have no effect if all put and get operations were performed
* without specifying :sync => true
*
* Returns:
* * true : On Success
* * false: On Failure
*
* comp_code and reason_code are also updated.
* reason will return a text description of the reason_code
*
* Throws:
* * WMQ::WMQException if comp_code != MQCC_OK
* * Except if :exception_on_error => false was supplied as a parameter
* to QueueManager.new
*/
VALUE QueueManager_backout(VALUE self)
{
PQUEUE_MANAGER pqm;
Data_Get_Struct(self, QUEUE_MANAGER, pqm);
if(pqm->trace_level) printf ("WMQ::QueueManager#backout() Queue Manager Handle:%ld\n", pqm->hcon);
pqm->MQBACK(pqm->hcon, &pqm->comp_code, &pqm->reason_code);
if(pqm->trace_level) printf("WMQ::QueueManager#backout() MQBACK completed with reason:%s\n", wmq_reason(pqm->reason_code));
if (pqm->comp_code != MQCC_OK)
{
if (pqm->exception_on_error)
{
VALUE name = rb_iv_get(self,"@name");
name = StringValue(name);
rb_raise(wmq_exception,
"WMQ::QueueManager#backout(). Error backing out changes to Queue Manager:%s, reason:%s",
RSTRING(name)->ptr,
wmq_reason(pqm->reason_code));
}
return Qfalse;
}
return Qtrue;
}