Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

I'm trying to update my push request table and only want the push table modified for the current person polling (my pollkey value is the ml username). I tried to use both {ml s.username} and ? to get the pollkey, but the first doesn't even let my listener run and the second doesn't seem to do anything.

Is there any way of getting the pollKey value in the Notifiers events? I'm using the light weight polling method, SQL Anywhere 12.0.1.

asked 08 Mar '12, 12:04

Peacock's gravatar image

Peacock
1917817
accept rate: 100%

edited 15 Mar '13, 21:20

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297


I believe you might have made a false assumption on how LWP and the Notifier works. The notifier events are not on the same line of execution of ML handling a sync. The Notifier has its' own line of execution in the embedded JVM of ML. The Notifier constantly monitor the consolidated database or external elements using the request_cursor and process pushes/confirmation etc. For LWP notifier, the push is simply to populate an in-memory bulletin board awaiting LWP clients to pull from it at their own pace without imposing consolidated db access nor authentification per such so called LWP access.

So, a LWP initiated by, say the listener (dblsn), will not invoke any Notifier event.

You can of course modify the content of your push request table in your ML synchronization events so that you can influence the request_cursor. This is infact the standard technique to implemt ACK for the LWP push. But this DML is not executed inside a Notifier event. The Notifier will query your push request table via your request_cursor at its' own line of execution (not in a ML sync).

To see what action variable is available to dblsn, you can simply run "dblsn -?". The variables are listed at the bottom of the usage text. $poll_key is listed.

-Wing

permanent link

answered 09 Mar '12, 05:55

Wing%20Wong's gravatar image

Wing Wong
266111
accept rate: 11%

edited 09 Mar '12, 06:07

In my original question, I was trying to update my push request table's status from 'Sync' to 'Processed', for the person doing the polling. But that's been moved to EndPublication sync script.

So now I have a question about the request_cursor. How do I make it only look for the current person doing the polling?

Right now my requestCursor statement is "select pollKey, subject, content from PushRequest where status='sync'". If I have 5 people with a status of sync, is it returning 5 rows back to the listener?

I wanted to modify the requestCursor to "select pollKey, subject, content from PushRequest where status='sync' and pollKey=$poll_Key".

(09 Mar '12, 13:05) Peacock

Wait a minute.. I think while I was eating lunch I figured out what you were saying. So just to confirm.

The Notifier polls the database, using its request cursor and stores all the returned values in its own internal datatable or something. If my requestCursor grabs from my push request table and grabs all the values where status = 'sync', it will possibly return 5 results.

My listener polls the notifier, which looks in its own internal datatable (which has 5 results) and compares the listeners pollKey with the first column (which is why the help says the requestCursor select statement must return PollKey, Subject, Content in that order). And then the notifier returns only the pollKey, subject, content to the listener if it found a match.

The notifier should only passively grab data and hold on to it.

Thank you.

(09 Mar '12, 13:47) Peacock
1

It might be too extreme to say the notifier should only passively grab data. There are other notifier events along the line of the notifier execution that one can use to compute and create pushes that is going to be selected by the request_cursor. One can also use a complex query against existing tables for the request_cursor without having the need of creating a push request table, insert into it and later having the request_cursor to plainly select from it. The notifier is not limited to be passive.

(09 Mar '12, 14:41) Wing Wong
Your answer
toggle preview

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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×438
×371
×84

question asked: 08 Mar '12, 12:04

question was seen: 2,230 times

last updated: 15 Mar '13, 21:20