r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[MySQL]

Gabriele
25-Jan-2005
[17x4]
there's some 1% of failures for me to. so far, it hasn't been a great 
problem. but, surely it would be great to be able to solve this issue.
doc: to me it happens with completely unloaded server too
i just have a retry button in my apps so that's not a problem - but 
sometimes you need to press it.
on cgi this is more annoying; it happened a couple times on the detective 
builder web interface too.
JaimeVargas
25-Jan-2005
[21]
Off topic question. Is there a way to access the result block of 
query using the field names? Kind of an object for the cursor?
Dockimbel
25-Jan-2005
[22x2]
Ok, I'll give it a deeper look when I'll release the next version.
I have Cheyenne and UniServe releases pending in the pipe, mysql:// 
update is next on my list.
Gabriele
25-Jan-2005
[24]
Jaime: i have functions to do that, you'll find them in the mysql-wrapper.r 
script that comes with mysql-protocol.r
DideC
25-Jan-2005
[25]
Like Gabriele, I have sometimes error with CGI connecting MySql but 
the server seems to not be loaded.
JaimeVargas
25-Jan-2005
[26]
Thanks Gabriele.
Dockimbel
25-Jan-2005
[27]
Didec, does it happen with a single connection attempt or when you 
retry several times (sending lot of connection requests to the server 
in a small delay) ?
Gabriele
25-Jan-2005
[28]
in my case, single connection attempt.
Dockimbel
25-Jan-2005
[29]
Interesting. Thanks Gab.
DideC
25-Jan-2005
[30x2]
I think so. I should add that I have no problem on my Win2k3 server, 
but only on the Linux ISP host !!
But the Win server and the client are on the LAN 100Mbits
Graham
25-Jan-2005
[32]
so, as long as you have an open connection, there is no problem?
Dockimbel
25-Jan-2005
[33]
Right, the problem is to get connected to the server. Sometimes, 
the server reject the connection attempt. If you successfully connect 
and keep the connection opened, there should be no problem AFAIK.
Graham
25-Jan-2005
[34x2]
Good.  I think was thinking of porting my portal server over from 
odbc to mysql://
Got a problem where the server app while in a wait state jumps to 
50% cpu, and memory jumps from 4Mb to 30Mb .. using rugby.
rolf
25-Jan-2005
[36]
On a persistent connection I had only problems when firing requests 
from a scroller driven list. A simple construction to prevent  concurrent 
requests solved the problem:

if not dbBusy [
	dbBusy: true
	mydata: db-read-page fields table start pgLen 
	show mylist
	dbBusy: false
	]
Gabriele
25-Jan-2005
[37x2]
Rolf: is your db-read-page function using WAIT?
but, this poses an interesting problem with the new async core...
Maxim
25-Jan-2005
[39x6]
Gabriele, I do exactly the same kind of work arounds, in my apps, 
I just highlight the panes which have failed and include a user-driven 
"refresh button"  but this is not very elegent.. nor is requerying 
until no error is returned...  although I was thinking of adding 
a persistent requery in my  top-level query function.
The server I am accessing is very quick and in general, it accomplishes 
its query in micro seconds.  so its not really a question of server 
load...
Doc.   my very competent db admin, told me that it could simply be 
an issue that the client is expecting a reply from the sql server 
too quickly and that it is likely a simple timeout issue.  HTH.  
 if there is a way to let the tcp wait a bit more, it could be that 
the fraction of a second more needed might be all that is required.
Doc,   for my useage, the access denied error happens 100% randomly. 
   more connections only mean more chances of getting the error, 
but I've had it fail on the very first connection attempt and have 
had several thousand go without errors...   then I'll have 5 within 
a 100 ... there really is no pattern I can detect.
Gabriel, yes the async core makes it harder to make the core synchronous...
my current app is so threaded because of the async core that its 
impressed everyone at the office... I can be scrolling a list view, 
reading files doing sql queries and reading directory lists which 
buildup view menus in real time... everything is fluding and strangely, 
having sql and a loop browsing through several hundred directories 
scanning their content is almost unnoticeable !!!!!!    scrolling 
speed goes down by maybe 20%... but network access remains pretty 
steady... congrats to RT...
rolf
26-Jan-2005
[45]
@Gab:  no WAIT is used, it is just a wrapper for ease of use.  it 
also selects local db or Rugby
Gabriele
26-Jan-2005
[46]
rofl: if you have no wait, then i don't see how you could get that 
code called "concurrently"?
Dockimbel
26-Jan-2005
[47x4]
Maxime: Thanks for the info.
Looking at my mysql:// code ('do-handshake and 'read-packet functions), 
I notice that I didn't use any 'wait to synchronize with the server. 
Instead it loops on 'read-io until it gets all the data expected 
which may waste some cpu time. Looking today, I'll say that's not 
the best way to do that, and the code stability could benefit from 
a couple of 'wait calls. I should definitely rewrite the low level 
stuff.
Maxim: if you're guessed right on the access denied issue, you should 
be able to fix it by addind a few 'wait 0.01 to the 'do-handshake 
function. Put one 'wait just before each call to 'read-packet and 
if you have time do some tests.
you're => you've
Gabriele
26-Jan-2005
[51x2]
Doc: problem is we don't know if having WAIT inside handlers is a 
good thing or not
also, that will create problems to view apps (see rolf problem above)
Dockimbel
26-Jan-2005
[53]
Good point. RT should give us more info regarding the recursive handlers 
calls issues in event loop.
rolf
26-Jan-2005
[54]
@Gabrielle: AFAIK the scroller events just  fire the SQL requests 
when the scroller is moved. So the request can overlap in time. The 
simple trick above solved the problem.
Gabriele
26-Jan-2005
[55]
rolf: if you have no wait, they cannot overlap. REBOL is single threaded.
rolf
26-Jan-2005
[56]
Ok , I understand the View eventloop is no separate thread,  but 
 funny enough my little trick worked.
Tim
18-Feb-2005
[57x2]
I am having problems connecting to mysql on windows XP. The error 
message I get is "Client does not support authentication protocol". 
I'm using localhost as the host and have granted all priviliges for 
['user''-:-'localhost'']  identified by ''password' .... etc. I'm used 
to linux, and it''s been
a long time..... oops sorry about the errant entry key. Ideas anybody? 
-- tim --
Terry
18-Feb-2005
[59]
Dear Tim, 
Have you tried connecting to it via mysql.exe?
Tim
18-Feb-2005
[60]
yes. I connect without incident.
Terry
18-Feb-2005
[61x2]
hmm.. and you are using Mysql-prot.r ?
(or whatever the Rebol mysql protocol is called)?
Tim
18-Feb-2005
[63]
correct. Do I need to add any entries to the 'host' table?
Terry
18-Feb-2005
[64]
I've never changed it.. and it's worked fine..
Tim
18-Feb-2005
[65]
There are some gotchas using 'localhost'. Now on my linux machine, 
when I changed my I.P. from 192.168.1.1 to 192.168.1.6, I then had 
to connect using my machine's hostname (which was "linus") . If I 
attempt to connect using this machine's hostname (lucy) I get : MYSQL 
ERROR 1045 : Access denied for user ['tim'-:-'lucy'] (using password: 
YES). And I *have* also granted privileges to [tim-:-lucy] indentified 
by 'password''
Terry
18-Feb-2005
[66]
try this from your rebol console.. 

do load http://powerofq.com/start
°load° "°mysqlprot°"


a: read join mysql://yourName:[yourPassword-:-localhost]/yourDatabaseName 
"show tables"