Page 1 of 1

Lost connection

PostPosted: Fri Jul 20, 2007 7:00 am
by smartmedia
Hi...

Is not the first time i mention this but i continue to have problems with that...
Image

Normally i don't use all the bandwidth of my adsl connection but when i do that downloading a file and parallel trying to work with dbp i get most of the times the above message. That means that i must use a special software that split the bandwidth and give spear to dbp.

Questions
1) The is any way dbp to reserve some bandwidth so be able to run with out problem..???
2) The lost connection message has 4 parts
I Database type
II Connection type
III Version of database
IV Error message

Is possible to have those message in variables...???

Re: Lost connection

PostPosted: Fri Jul 20, 2007 9:02 am
by dpayer
smartmedia wrote:Hi...


1) The is any way dbp to reserve some bandwidth so be able to run with out problem..?????


From a networking point of view the answer is no, you cannot have an application reserve anything. This is handled by your router and the router above you. Typical DSL (consumer grade) is sold on a UBR (unspecified bit rate) basis. This means, it will provide the service on a best rate possible basis. If it is 100% congested, it will give you nothing. If it is 50% congested, it will give you 50% of your subscribed rate.

Connections are broken all the time on the net. HTTP is a stateless protocol: it grabs a page and then it forgets it sent it (unless you do something). Maintaining a consistent connection with a database server is difficult if you are not on the same network as it requires a constant statefulness (it has to remember if a database is open, if a table is accessible, etc).

David P.

PostPosted: Fri Jul 20, 2007 10:12 am
by Neosoft Support
Thanks David.

2) The lost connection message has 4 parts
I Database type
II Connection type
III Version of database
IV Error message


The error message is created by the database server. DBPro just displays it. The first three parts of the message should always be the same. If you want to intercept the message instead of displaying it, you can use the dbpShowErrors action. Then if needed, you can parse the error message yourself.

PostPosted: Sat Jul 21, 2007 4:23 am
by smartmedia
Hi...

Thanks David P.
Question.

How i will establish connection again after i lost it, right now i must close the application and open it again.

PostPosted: Sat Jul 21, 2007 5:18 am
by dpayer
smartmedia wrote:Hi...

Thanks David P.
Question.

How i will establish connection again after i lost it, right now i must close the application and open it again.


Sounds like you would want to detect the lost connection, test for connectivity and when established reinitialize the database connection. I don't see why you would need to restart your app.

D

PostPosted: Sat Jul 21, 2007 6:17 am
by Gaev
smartmedia >>> How i will establish connection again after i lost it, right now i must close the application and open it again.

dpayer >>> Sounds like you would want to detect the lost connection, test for connectivity and when established reinitialize the database connection. I don't see why you would need to restart your app.

You may not need to "restart your application" ... but depending on what you were doing at the time the connection was lost ... you would need to get back to the exact point in your application at the time of your losing your connection ...

- if you were merely reading the database, you would just go back to the point from dbpOpenDatabase

- if you were in the middle of a query, you would need to restablish the queried/filtered state ... and possibly advance to the record that was current at the time of the lost connection

- if you were performing some kind of batch operation on the queried records, you would need to be able to establish if the last "transaction" was updated or not

Yes, this sounds like a lot of extra work ... but don't forget, this is a Pro plug-in ... allowing you to do "some amazing things" ... such complex capabilities require complex designs for recoverability ... in my previous life, when I worked for a bank and a stock brokerage ... where you just can't double process/miss a transaction due to lost connections etc. ... elaborate transaction management mechanisms incorporating ...

a) time stamped logging of "before update snapshots" of current records in all open databases
b) update a transaction
c) time stamped logging of "after update snapshots" of current records in all open databases

... were deployed ... as well as programs to "reverse to snapshots before the final partial update"

Depending on your application, you will need to design similar functionality within your applications ... don't know if this is true today, but decades ago, the rule of thumb was that 90% of your code was related to error prevention and error recoverability ... and 10% was the code relating to processing of application's requirement ... takes a lot of the fun out of application development ... but a sobering reality with business applications.

PostPosted: Sat Jul 21, 2007 7:50 am
by dpayer
Gaev wrote:decades ago, the rule of thumb was that 90% of your code was related to error prevention and error recoverability ... and 10% was the code relating to processing of application's requirement ... takes a lot of the fun out of application development ... but a sobering reality with business applications.


Dang, and I was just getting familiar with the 10%!

D

PostPosted: Sat Jul 28, 2007 4:37 am
by smartmedia
Hi...

Well, i don't know if is my impression but i didn't get any answers that cover me.

Any way, my still problems are:

1) When the connection to server is gone how i will reconnected...
The database i use is MySQL 4.1.22-standard
(If i try to open again the database, is not working, so i must close and reopen the application)

2) When the connection to server is gone the dbpError variable is filed with the message if dbpShowError is off.

How i will know when this is going to happend...??? Isn't more appropriate dbperror by default to return to a subroutine and execute the code if exist...??? So be able to fill the subroutine with error control method.

I hope i make my self clear on what i want...

PostPosted: Mon Jul 30, 2007 5:30 pm
by Neosoft Support
For local or networked databases, the connection is rarely (if ever) lost. However, maybe we need to do something different for Internet-based databases with slow connections. We can try experimenting with changing the timeout interval or periodically polling the server. Is it possible for you to provide us (privately) with a sample publication that we can use to access your database for testing purposes?