Print Thread
Page 2 of 2 1 2
Re: ToracleEvent problems
#7416 05/09/05 10:26 PM
Joined: Feb 2004
Posts: 15
J
joet Offline OP
Member
OP Offline
Member
J
Joined: Feb 2004
Posts: 15
I was in a hurry and bought the object version seperately. can you halpe me get a partial refund please?

Thanks,

Joe

Re: ToracleEvent problems
#7417 05/10/05 09:04 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
Sure, I will send you an e-mail shortly.


Marco Kalter
Allround Automations
Re: ToracleEvent problems
#7418 05/10/05 10:47 PM
Joined: Feb 2004
Posts: 15
J
joet Offline OP
Member
OP Offline
Member
J
Joined: Feb 2004
Posts: 15
I have defined the following object. When I dequeue it and try to get the data via the TOraclequeue->Payload->GetAttr(); It hangs my service. IS there some step I'm missing? I get the MessageID ok but any data accessed via getattr causes issues. I noticed a queuetype but I can't seem to set that. does it default to qtObject?

create type feature_package_type as object
(
app_feature_id number(10),
feature_id number(10),
app_id varchar2(7),
service_no_id varchar2(7),
service_no varchar2(20)
);

fprintf(ptr, "Calling Dequeue Function%s \n", DateTimeToStr(Now()));
OracleQueue1->Dequeue();
fprintf(ptr, "Message received: %s \n" , OracleQueue1->MessageProperties->MsgId);
fprintf(ptr, "App feature_id = %s \n", OracleQueue1->Payload->GetAttr("app_feature_id"));

Re: ToracleEvent problems
#7419 05/11/05 09:34 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
Did you set TOracleQueue.Threaded to True? In that case the Dequeue call will merely spawn a thread, and the OnThreadDequeued event handler will be called when a message has been dequeued.

The QueueType property reflects the type of the queue. You cannot set it, since it depends on the QueueName property.


Marco Kalter
Allround Automations
Re: ToracleEvent problems
#7420 05/12/05 06:30 PM
Joined: Feb 2004
Posts: 15
J
joet Offline OP
Member
OP Offline
Member
J
Joined: Feb 2004
Posts: 15
Marco,

Yes I have tried setting the Threaded property to true. My onThreadDequeued evnt handler looks like this.

fprintf(ptr, "Message received: %s \n", Sender->MessageProperties->MsgId);
fprintf(ptr, "%s \n", Sender->Payload->GetAttr("app_feature_id"));


this causes the service to hang. If I remove the line fprintf(ptr, "%s \n", Sender->Payload->GetAttr("app_feature_id")); it works fine. I've included the code I used to define my object, create and start my queue and to queue up a sample message. What am I doing wrong?


create type feature_package_type as object
(
app_feature_id number(10),
feature_id number(10),
app_id varchar2(7),
service_no_id varchar2(7),
service_no varchar2(20)
);

begin
dbms_aqadm.create_queue_table(queue_table => 'fea_package_queue_table',
queue_payload_type => 'feature_package_type');
dbms_aqadm.create_queue(queue_name => 'feature_package_queue',
queue_table => 'fea_package_queue_table');
dbms_aqadm.start_queue(queue_name => 'feature_package_queue');
commit;
end;

DECLARE
queueopts DBMS_AQ.ENQUEUE_OPTIONS_T;
msgprops DBMS_AQ.MESSAGE_PROPERTIES_T;
msgid RAW(16);
my_msg feature_package_type;
BEGIN
my_msg := feature_package_type(1234567890,1234567,'123abc','abc123','2486564210');

DBMS_AQ.ENQUEUE ('feature_package_queue',
queueopts,
msgprops,
my_msg,
msgid);
END;
Commit;

Re: ToracleEvent problems
#7421 05/12/05 07:46 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
You will have to debug this to find out if there is an exception. The GetAttr function will not hang.


Marco Kalter
Allround Automations
Re: ToracleEvent problems
#7422 05/12/05 08:24 PM
Joined: Feb 2004
Posts: 15
J
joet Offline OP
Member
OP Offline
Member
J
Joined: Feb 2004
Posts: 15
Marco,

This code works fine in an application. It only causes issues when I try to include it in a windows service. Can you see if you can reproduce this issue on your end?

Re: ToracleEvent problems
#7423 08/04/05 07:49 PM
Joined: Feb 2004
Posts: 15
J
joet Offline OP
Member
OP Offline
Member
J
Joined: Feb 2004
Posts: 15
did you ever have a chance to look at this? this works fine in an application but when used as a windows service it hangs! also any progress on the situation where you lose a database connection and want to reconnect without recreating the queue?

Thanks,

Joe

Re: ToracleEvent problems
#7424 08/05/05 07:43 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
I have not been able to reproduce this. Like I said, the GetAttr function will not hang.


Marco Kalter
Allround Automations
Page 2 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.107s Queries: 13 (0.043s) Memory: 2.5597 MB (Peak: 3.0429 MB) Data Comp: Off Server Time: 2024-05-20 21:37:43 UTC
Valid HTML 5 and Valid CSS