Triggering a method

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

Postby Morley » Fri Jun 30, 2006 11:10 pm

I've now rolled back newRecord to:
Code: Select all
controller.loadAllRecords();
controller.newRecord();
controller.saveData();
return 'ok';
I've also turned off the dailyUpdate batch process. Haven't yet found a way to totally disable this batch process. Thus the crons dailyUpdate launches are still in place. I've also shut down Servoy Developer which is pulling data from the server (so I can detect whether a new record has been created). For now, this is as simple as I can make it.

Result? The same. A newClient session is created. OK is printed to the web page. No new record is created.

Are there other diagnostics that can be added to identify what's going on here? Are any of the logs at /Applications/Servoy/server/logs relevant here? The backend is Sybase. The log at /Applications/Servoy/sybase_db/sybase_log.txt shows no activity for today.

Kind regards,
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby jcompagner » Fri Jun 30, 2006 11:43 pm

and if you run that method in the developer? what happens then just in debug mode?

Also what are you trying to do with that code you send like this:

Code: Select all
var size1 = controller.getMaxRecordIndex()
return size1
controller.loadAllRecords()
var size2 = controller.getMaxRecordIndex()
return size2
....
return ok

this doesnt of course make anysense. The first return will hit and will return the size1 and the rest of the code is ofcourse never executed.
Use application.output("Size1:" + size1); for these things.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Morley » Sat Jul 01, 2006 5:58 am

jcompagner wrote:and if you run that method in the developer? what happens then just in debug mode?

Also what are you trying to do with that code you send like this:

Code: Select all
var size1 = controller.getMaxRecordIndex()
return size1
controller.loadAllRecords()
var size2 = controller.getMaxRecordIndex()
return size2
....
return ok

this doesnt of course make anysense. The first return will hit and will return the size1 and the rest of the code is ofcourse never executed.
Use application.output("Size1:" + size1); for these things.
Johan, I'm following along on and attempting to expand on Jan's recommendation (return 'OK') to test out whether the method is triggering or not. The coding syntax is not familiar to me. I was making a clumsy attempt to expand on it, not knowing what else to try. I'm not surprised it didn't work.

The essential problem is a new record is not being created when the method is triggered. There's no obvious reason why it's not. The important issue here is why, in the face of an apparently dead simple structure, is a new record not being triggered when called by a JSP but works fine when called from within Servoy? Jan's test proves the method is being triggered by the JSP but the command calling for the creation of a new record is being ignored. Why?

We've tried several techniques such as saveData and loadAllRecords. We've rulled out security. No log-in is required. I'm ready to try any technique which will tease out the answer to that question -- why isn't a new record being created?

Much thanks to everyone for your attention to this problem,
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby Jan Aleman » Sat Jul 01, 2006 9:08 am

So what are the results of running Johan's recommend method in developer? Paste it, run it and paste the output of your debug window here, Johans is trying to help you so no need to go into a discussion about that.
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Morley » Sat Jul 01, 2006 2:49 pm

jaleman wrote:So what are the results of running Johan's recommend method in developer? Paste it, run it and paste the output of your debug window here, Johans is trying to help you so no need to go into a discussion about that.
Here's the revised newRecord method and its result when stepped through via the debugger:
Code: Select all
controller.loadAllRecords();
var vSize1 = controller.getMaxRecordIndex();
application.output('vSize1 = ' + vSize1);
controller.newRecord();
controller.saveData();
var vSize2 = controller.getMaxRecordIndex();
application.output('vSize2 = ' + vSize2);
return 'ok';

Debugger output:
vSize1 = 33
vSize2 = 34
Somehow Servoy and/or the Sybase backend is making a distinction between an action originating via a JSP and one started within Servoy Developer.

Earlier this morning I thought the fact that the JSP isn't going through Servoy Security might be the distinguishing point. But now I don't think so. In order to perform the above experiment I launched Servoy Developer from scratch and went directly to the newClient solution. I did not log in, Servoy Security wasn't visited.

Yet somehow Servoy and/or Sybase is recognizing a difference between the two initiators. What could that be? Perhaps Servoy is sending the command but Sybase is ignoring it because it doesn't recognize it as authentic. Is that possible, how could that be tested?

Kind regards,
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby jcompagner » Sun Jul 02, 2006 12:58 am

there isn't much difference when doing it from jsp or not.
Because both times pretty much the same thing under de hood happens.

For example if you run it in 3.0 and then as webclient. That is very close to what you do with jsp. Does it then work?

But if you can send me an solution that shows it. Then i can look at it more closely.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Morley » Sun Jul 02, 2006 3:47 am

jcompagner wrote:there isn't much difference when doing it from jsp or not.
Because both times pretty much the same thing under de hood happens.

For example if you run it in 3.0 and then as webclient. That is very close to what you do with jsp. Does it then work?

But if you can send me an solution that shows it. Then i can look at it more closely.
The JSP is extremely simple (quoted in full earlier in this thread) and the method it activates is even simpler -- create a new record (also quoted in full earlier in this thread). I am consistently finding a session is launched, the method activates but a new record is not created. The command is ignored or passed over. And no error is reported in the server log. (Haven't checked the Sybase logs because I don't know where to look.)

However, if I open the same solution with Servoy Developer and step through the method with the debugger a new record is created. Somehow it matters whether it's the Servoy Developer session that's activating the method or its the JSP. Somehow that difference is being detected. And it's been consistent, no variations.

This is Servoy 2.2.5 and Sybase Anywhere 9.0.1 running on an Xserve under Mac OS X 10.3.9.

The ultimate purpose of this project is to enable new clients of our service to self register -- to fill in a web form and have their info ported into the appropriate tables within the solution, setting them up for service. When running the full JSP we're getting repeated save data errors and found no new records were being created. Therefore I simplied the JSP down to just create a new record.

Jan recommended I add saveData() to the method. Then suggested I add loadAllRecords() before calling for a new record. He asked whether there was a security issue. No log-in is required on this solution. He suggested I add "return 'ok'" so I could see if this method was indeed firing. The web page now gets OK printed to the screen with each trial.

The results have always been consistent. A new client is created for the solution, OK is printed to the screen, no errors are reported to the server log and no new record is created when the activation is from the JSP. But when activated from Servoy Developer a new record is created every time.

I'll do whatever it takes to get over this hump.
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby Harjo » Sun Jul 02, 2006 7:58 am

Morley wrote:I'll do whatever it takes to get over this hump.


jcompagner wrote:But if you can send me an solution that shows it. Then i can look at it more closely.


Morley, are you also doing what Johan is suggesting?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby IT2Be » Sun Jul 02, 2006 10:12 am

What happens when you start Servoy Server?
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby Morley » Sun Jul 02, 2006 6:04 pm

IT2Be wrote:What happens when you start Servoy Server?
It starts up and the server log reports:
2006-06-29 09:32 : Loading servoy.properties from /Applications/Servoy/servoy.properties
2006-06-29 09:32 : Loading - Done
2006-06-29 09:32 : Using RMI registry on port 1099
There's a batch processor set to run on this server called dailyUpdate. It's startup method initiates some Chrons and daily/weekly/monthly runs certain methods.

For purposes of simplifying the conditions while working out this problem I've tried to indefinitely suspend this batch processor and have been unable to. The batch processor says click the Delete button. There isn't one. The Remove button stops the batch processor but on a subsequent reboot of the server the batch processor is relaunched. Frustrating.

There's one more phenomena happening on this server. Occasionally, but not always, when I have uploaded a new version of the newClient method and reboot the server log adds one or more lines like this:
2006-06-29 09:47 : Error occured informing client plugin udp, error: java.lang.NullPointerException
Earlier in this thread Robert Ivens said this error message was irrelevant to the problem at hand.

There is no other activity I'm aware of on this server. I've done no fancy manoevers on it or on the Servoy installation or on the Sybase back end. As far as I'm aware, this is pretty standard default stuff.

I have one very large question to ask of the readers of this thread. Is it possible to track the movement of the SQL command Servoy is issuing to the back end? For instance is the command even being issued. I presume it is, have no reason to believe otherwise but have no proof one way or the other. Is it possible to see what Sybase is doing to that SQL command, whether it's receiving it, whether it's rejecting it for some reason? Is there a Sybase log which will give useful information?

Thank you for your kind attention to this problem.
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby jcompagner » Mon Jul 03, 2006 10:40 am

ok i tested your solution on my servoy 2.2.5
and it worked fine.. I do see a new record appearing in the developer when i hit the jsp. And the jsp tells me OK
and the log says:

vSize1 = 35
vSize2 = 36

You can see what command are send to sybase in the servoy admin pages and that database performance link. All queries are logged and profiled there.

and i do see 2 inserts when i hit the page twice.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Morley » Mon Jul 03, 2006 2:56 pm

jcompagner wrote:ok i tested your solution on my servoy 2.2.5
and it worked fine.. I do see a new record appearing in the developer when i hit the jsp. And the jsp tells me OK
and the log says:

vSize1 = 35
vSize2 = 36

You can see what command are send to sybase in the servoy admin pages and that database performance link. All queries are logged and profiled there.

and i do see 2 inserts when i hit the page twice.
Here's what's happening here. I reboot the server and then run the JSP. The server log shows no errors. A new client session is connected.

I'll quote the Database Performance in full. Bear with me, I've not often examined raw SQL commands. I've added my guesses as to what I believe each segment signifies.
loadAllRecords?

select scratch.scratchid, scratch.user_name, scratch.pword1, scratch.pword2, scratch.user_status, scratch.person_first, scratch.person_last, scratch.company_name, scratch.first_last_name, scratch.job_func, scratch.phone_ac1, scratch.phone_ac2, scratch.phone_ac3, scratch.phone_cc1, scratch.phone_cc2, scratch.phone_cc3, scratch.phone_local1, scratch.phone_local2, scratch.phone_local3, scratch.email1, scratch.email2, scratch.email3, scratch.web1, scratch.web2, scratch.web3, scratch.sev_id, scratch.peo_id, scratch.sec_id, scratch.com_id, scratch.cus_sup_status, scratch.peo_city, scratch.com_city, scratch.peo_pcode, scratch.com_pcode, scratch.peo_region, scratch.com_region, scratch.peo_street_no, scratch.com_street_no, scratch.peo_street_name, scratch.com_street_name, scratch.peo_suite, scratch.com_suite, scratch.com_street_detail, scratch.peo_street_detail, scratch.peo_country, scratch.com_country, scratch.calc_match_name, scratch.peo_fullname, scratch.peo_search_fullname, scratch.peo_first1, scratch.peo_last1, scratch.calc_match_com, scratch.cust_supp, scratch.source1, scratch.fmp_contactid, scratch.fmp_calldate, scratch.creation, scratch.creation_by_id, scratch.com_street_name1, scratch.peo_street_name1, scratch.cpjoin_id, scratch.email_id, scratch.phone_id, scratch.contact_id, scratch.client_phone_id, scratch.client_cpjoin_id, scratch.client_email_id, scratch.client_id, scratch.locale_timezone, scratch.locale_lang, scratch.locale_time_zone, scratch.user_name_lc from scratch where scratch.scratchid in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)

newRecord?

insert into scratch ( scratchid, user_name, pword1, pword2, user_status, person_first, person_last, company_name, first_last_name, job_func, phone_ac1, phone_ac2, phone_ac3, phone_cc1, phone_cc2, phone_cc3, phone_local1, phone_local2, phone_local3, email1, email2, email3, web1, web2, web3, sev_id, peo_id, sec_id, com_id, cus_sup_status, peo_city, com_city, peo_pcode, com_pcode, peo_region, com_region, peo_street_no, com_street_no, peo_street_name, com_street_name, peo_suite, com_suite, com_street_detail, peo_street_detail, peo_country, com_country, calc_match_name, peo_fullname, peo_search_fullname, peo_first1, peo_last1, calc_match_com, cust_supp, source1, fmp_contactid, fmp_calldate, creation, creation_by_id, com_street_name1, peo_street_name1, cpjoin_id, email_id, phone_id, contact_id, client_phone_id, client_cpjoin_id, client_email_id, client_id, locale_timezone, locale_lang, locale_time_zone, user_name_lc) values ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )

saveData?

select scratch.scratchid from scratch order by scratch.scratchid
This last item has a "Count = 2". Unfamiliar with the count column.

If I'm interpreting the above correctly, Servoy is sending the newRecord request to the back end. If so, the question now is what's Sybase doing with it, why is it not acting on it. Is there an appropriate Sybase log to look at?

Kind regards,
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby jcompagner » Mon Jul 03, 2006 3:03 pm

you just have to look at the insert sql query.
You see there 2 times or more (depending how many times you ask for the jsp) a insert statement that a new record is made.

So it displays 35 or 36
if you then restart servoy and do it again. Where does it starts from ?
again 35 to 36?
or is it then 36 37??

johan
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Postby Morley » Mon Jul 03, 2006 4:29 pm

jcompagner wrote:you just have to look at the insert sql query.
You see there 2 times or more (depending how many times you ask for the jsp) a insert statement that a new record is made.

So it displays 35 or 36
if you then restart servoy and do it again. Where does it starts from ?
again 35 to 36?
or is it then 36 37??

johan
"So it displays 35 or 36.". Please clarify, I don't quite follow what you're asking.

I restart the server and run the JSP. The insert sql query looks identical to the previous test. I'm unclear about how to find what you mean by its starting point. When I restart Servoy Developer the very first of 35 records is selected. Is this what you mean by "where does it start from"?

Kind regards,
Morley Chalmers
7Office Inc.
User avatar
Morley
 
Posts: 891
Joined: Fri Apr 25, 2003 4:54 pm
Location: Toronto, Canada

Postby jcompagner » Mon Jul 03, 2006 4:35 pm

if you restart servoy
Then again you make new records by invoking that jsp

And you see Output like 35 , 36 or something like that.
Before and End count.

When you restart servoy completely and do exactly the same thing again
So invoke you jsp again. What is the output....
Is it again 35, 36 OR is it greater then that?? is it 36,37 or what ever.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

PreviousNext

Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 4 guests

cron