Source language: Translate to:

Window is not responding

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Window is not responding

Postby smartmedia » Wed Aug 29, 2007 8:42 pm

Hi...

I have create an application, it has a login button, when is pressed the user been authenticate it, running some SQL query's and then goto different page.

The problem is that in 99/100 time the window freeze and in Title writes that (The application is not responding), also the color of the screen become white, if you wait after 5-6 seconds the application continue and running.
This is a major "bug" for me, i have check.
The code which is running is a simple code with MySQL queries without any loops or whiles ....

Please Dave, any help...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Thu Aug 30, 2007 9:58 am

The problem is that in 99/100 time the window freeze and in Title writes that (The application is not responding), also the color of the screen become white, if you wait after 5-6 seconds the application continue and running.


It sounds like the SQL commands you're executing are taking 5-6 seconds to complete. NeoBook is probably just waiting for the server to finish whatever you've asked it to do.

What SQL commands are you executing?

If there are lots of them, you could try creating a stored procedure which should execute faster than individual SQL commands.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby smartmedia » Thu Aug 30, 2007 11:04 pm

Hi...

I am using MySQL 4.1 standard, i don't know if that version support stored procedures, if not they is any other way to accelerate the code running without having this visual problems...???
This also happens with other code when is enough, so is more like NB way to respond is this crisis.

Also i need an example how to setup a stored procedure because i don't know...

Thanks again...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Fri Aug 31, 2007 10:34 am

Information about stored procedures:

http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html

However, I think stored procedures are only supported in MySql 5.0+.

I assume that your pub must wait for the SQL commands you're executing to finish before continuing. If the SQL driver is hogging all of the system resources, then I'm not sure what NeoBook can do about that. Five to six seconds really isn't a long time to wait, especially if your database is located on a remote server and you're using a slow or unreliable Internet connection. Can you place a message on-screen telling the use to wait patiently while the program communicates with the server?

Also, what SQL commands are you using that are taking so long? Maybe there are faster alternative commands that you could use. Maybe the structure of the database could be configured differently to improve performance. Maybe you could index the database.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby smartmedia » Mon Sep 03, 2007 5:19 am

Hi...

Neosoft Support wrote:Also, what SQL commands are you using that are taking so long? Maybe there are faster alternative commands that you could use. Maybe the structure of the database could be configured differently to improve performance. Maybe you could index the database.


Well, after long test, finally i came up with a conclusion:
In my database there is a table called "Data", now if for any reason run a SQL Query to take any results the Table is been downloaded 100%. Right now the table is 1 MB, that's why is taking to long and the window freeze. I suppose that also happens with the other tables in my database just the size is to small.

i don't know if is a bug or what but is something that must be done...

Please, this is a critical for me...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby dpayer » Mon Sep 03, 2007 6:47 am

smartmedia wrote:Hi...
Well, after long test, finally i came up with a conclusion:
In my database there is a table called "Data", now if for any reason run a SQL Query to take any results the Table is been downloaded 100%. Right now the table is 1 MB, that's why is taking to long Please, this is a critical for me...


I would think that if you are building an application that talks to a remote database, you would want to query the database directly and not download it and then query it.

That is the value of a central repository of data on a database such as MySQL. Even a complex query on a MySQL database (with 1 meg of data) should take less than a second on a reasonable server, I would think.

What causes the download of the data? Are you requesting the data so you can sort it locally? Can you limit your query so a smaller set of data is shown?

David P.
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby smartmedia » Mon Sep 03, 2007 10:21 am

dpayer wrote:I would think that if you are building an application that talks to a remote database, you would want to query the database directly and not download it and then query it.

That is the value of a central repository of data on a database such as MySQL. Even a complex query on a MySQL database (with 1 meg of data) should take less than a second on a reasonable server, I would think.

What causes the download of the data? Are you requesting the data so you can sort it locally? Can you limit your query so a smaller set of data is shown?

David P.


Hi David.
I use a simple SELECT COUNT in the beginning and then a SELECT asking the data of only one field of 10 fields they are in table...
Is strange for me also... I do not do any sort or any other indexing.
MySQL is version 4.1 standard.
Have you tried to do something similar...???
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby smartmedia » Tue Sep 04, 2007 10:18 am

Hi...

This issue is critical for me, right now the database is 1mb but soon will be greater, i need to know what to...


PLEASE NB SUPPORT
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Tue Sep 04, 2007 11:06 am

The dbpOpenTable action will automatically perform a show all type query when opening a table. You want to avoid this with your large table, so you should use dbpExecSQL to open your table instead of dbpOpenTable. For example:

dbpExecSQL "DB1" "SELECT * FROM tablename WHERE field = x" ""

...or something similar.

This will allow you to open the table and limit the amount of data returned.

Once the table is opened, you can use any of DBPro's normal actions.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby smartmedia » Tue Sep 04, 2007 12:28 pm

Hi...

I don't use dbpOpenTable at all, the only commands i use are dbpExecSQL with SELECT COUNT(*) and SELECT with filter.

Please, do a test for your self in MySQL and you will see...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Neosoft Support » Tue Sep 04, 2007 2:30 pm

Add the table name to the dbpExecSQL actions' Results Table parameter. For example:

dbpExecSQL "DB1" "SELECT * FROM tablename WHERE field = x" "tablename"

I tested this on a 74Mb database and the speed improvement was dramatic.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby smartmedia » Wed Sep 05, 2007 6:08 am

Hi...


YES.YES.YES.YES.YES.YES.YES.YES

Has worked 100%
I wonder why, this is a bug or a normal behaviour...??? After all you say that the table is optional...

Thanks again...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby dpayer » Wed Sep 05, 2007 9:28 am

smartmedia wrote:Hi...


YES.YES.YES.YES.YES.YES.YES.YES

Has worked 100%
I wonder why, this is a bug or a normal behaviour...??? After all you say that the table is optional...

Thanks again...


I think naming a table would be optional if your database structure did not support tables. If it DOES support tables and you are using a specific table (among many possible ones in the database) I would think you need to name it.

D
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Neosoft Support » Wed Sep 05, 2007 11:03 am

In an effort to make DBPro accessible to non-SQL users, it automatically performs a basic show-all type query whenever a table is opened. If you call dbpExecSQL without a results table it does the same thing which may not be necessary. However, if you call dbpExecSQL with a results table it does not first perform a show-all query. Maybe this behavior can be changed in the future, but we'll need to do some testing to make it doesn't cause any unintended problems.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby smartmedia » Thu Sep 06, 2007 6:23 am

Hi...

I simple explanation in help file with a simple example will be ok...
How i will know that if i don't put the "optional" table after executing an query will download all the table.
Any way, just an explanation for all users in help will do...

Thanks again...
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Next

Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest