mysql performance

This is a discussion on mysql performance within the MySQL Database forums, part of the Database Forums category; Hi All, I develop an application in java in that several objects are querying a database, occasionally simultaneous. I think ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-04-2007
korcs
 
Posts: n/a
Default mysql performance

Hi All,

I develop an application in java in that several objects are querying
a database, occasionally simultaneous.

I think when this happens, the mysql server returns with an error
message to one of this objects.

My question is: what is the best practice when competeing objects are
using the same resource?

I was thinking on using table locks, but I am not sure whether it is
the most elegant way to solve it.

Any good experiences, ideas?

Best,

korcs

Reply With Quote
  #2 (permalink)  
Old 09-04-2007
Jerry Stuckle
 
Posts: n/a
Default Re: mysql performance

korcs wrote:
> Hi All,
>
> I develop an application in java in that several objects are querying
> a database, occasionally simultaneous.
>
> I think when this happens, the mysql server returns with an error
> message to one of this objects.
>
> My question is: what is the best practice when competeing objects are
> using the same resource?
>
> I was thinking on using table locks, but I am not sure whether it is
> the most elegant way to solve it.
>
> Any good experiences, ideas?
>
> Best,
>
> korcs
>


What kind of error are you getting? What do you mean by competing
objects are "using the same resource"? That is, what resource?

MySQL handles concurrent requests quite well.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #3 (permalink)  
Old 09-04-2007
Gordon Burditt
 
Posts: n/a
Default Re: mysql performance

>I develop an application in java in that several objects are querying
>a database, occasionally simultaneous.


>I think when this happens, the mysql server returns with an error
>message to one of this objects.


The normal MySQL response to two requests that conflict is to make
one wait, so they happen as though one came after the other. If,
for example, you are trying with two different requests to insert
a record with the same primary key, and that is causing an error,
you are computing a new primary key wrong (try an auto-increment
column).

If you THINK there is an error message, try actually logging it, along
with the query that caused it and perhaps a time stamp.

>My question is: what is the best practice when competeing objects are
>using the same resource?


What resource? A table?

>I was thinking on using table locks, but I am not sure whether it is
>the most elegant way to solve it.


If you have a series of changes that need to be made all-or-nothing
without interference from something else, use transactions (and
InnoDB tables).


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:14 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0