Android Question SocketTimeoutException Inserting into MSSQL Database

scott parkin

New Member
Licensed User
Hi
I've got an issue I cant resolve

I'm inserting data into an MSSQL database using httputils and and the web service method and i keep getting JobName = Startjob, Success = false , Error: java.net.SocketTimeoutException

the strange thing is that when i check the database the data has been inserted/updated

selects seem to work fine I only seem to get the error when inserting or updating
 

sorex

Expert
Licensed User
how long does it take? there are script execution limits to prevent endless loops to take up all resources.

I think it's 30 seconds for PHP and 60 for IIS.

You can change/extend it in your script tho.
 

scott parkin

New Member
Licensed User
it's taking 60 seconds which is the time out I set for the job
it seems to me it's never receiving a response back from the server when doing an insert or update so it's timing out

i've included one of the insert commands

B4X:
Stopjobsecoppost.Initialize("Stopjobsecoppost" , Me)

Stopjobsecoppost.PostString(ServerUrl , "INSERT INTO PRODJOURNALROUTE  (JOURNALID  ,LINENUM  ,TRANSDATE  ,PRODID  ,OPRNUM  ,JOBTYPE  ,WRKCTRID ,HOURS , HOURPRICE , QTYGOOD, QTYERROR, ERRORCAUSE  ,CATEGORYHOURSID  ,QTYPRICE  ,EMPLID  ,OPRFINISHED  ,CATEGORYQTYID  ,EXECUTEDPCT  ,JOBFINISHED  ,OPRPRIORITY  ,DIMENSION  ,DIMENSION2_  ,DIMENSION3_  ,FROMTIME ,TOTIME  ,JOBID  ,OPRID  ,CANCELLED  ,PRODINVENTDIMID  ,PRODREPORTFINISHED  ,PRODPICKLIST  ,PRODPICKLISTJOURNALID  ,PRODREPORTFINISHEDJOURNALID  ,DATAAREAID  ,RECVERSION  ,RECID  ,ARD_BUNDLEID  ,ARD_BUNDLEQTY  ,ARD_APPROVAL) VALUES ( '"&Journalid&"',"&LastlineNum&",'"&TRANSDATE&"','"&PRODID&"',"&OPRNUM&","&JOBTYPE&",'"&WRKCTRID&"',"&HOURS&","&HOURPRICE&","&Qtygood&","&QtyError&","&ERRORCAUSE&",'"&CATEGORYHOURSID&"',"&QTYPRICE&",'"&EMPLID&"',"&OPRFINISHED&",'"&CATEGORYQTYID&"',"&EXECUTEDPCT&","&JOBFINISHED&","&OPRPRIORITY&",'"&DIMENSION&"','"&DIMENSION2_&"','"&DIMENSION3_&"',"&FROMTIME&","&TOTIME&",'"&JOBID&"','"&OPRID&"',"&Cancelled&",'"&PRODINVENTDIMID&"',"&PRODREPORTFINISHED&","&PRODPICKLIST&",'"&PRODPICKLISTJOURNALID&"','"&PRODREPORTFINISHEDJOURNALID&"','"&DATAAREAID&"',"&RECVERSION&","&recid&","&ARD_BUNDLEID&","&ARD_BUNDLEQTY&","&ARD_APPROVAL&")")
Stopjobsecoppost.GetRequest.Timeout = 60000
 

sorex

Expert
Licensed User
also the timeout you set in B4A has no use when the script time out on the server is less.
 

scott parkin

New Member
Licensed User
I'm using the example that's on the "Connect Android to MS SQL" tutorial is that configured to give a response
 

scott parkin

New Member
Licensed User
thanks
I haven't used asp.net so not sure what the service was doing I'll have a go at modifying it to handle Insert/Update requests

if anyone has any pointers or already have a modified service already that I can have a copy of it would be appreciated
 
Top