Ashley Sheridan wrote:
On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote:
function getMax($table, $field)
If I saw this sort of code I'd be appalled! It's possibly the worst way
to get the auto increment value. You won't notice it testing the site
out on your own, but all hell will break
On Wed, Feb 03, 2010 at 06:39:29AM +0100, Rene Veerman wrote:
> On Wed, Feb 3, 2010 at 5:49 AM, Jochem Maas wrote:
> > you can bet you ass that every other DB out there that's worth it's salt
> > has atomic id incrementor functionality exposed in some way or other.
> >
> > @Rene: all that talk of
On Wed, Feb 3, 2010 at 5:49 AM, Jochem Maas wrote:
> you can bet you ass that every other DB out there that's worth it's salt
> has atomic id incrementor functionality exposed in some way or other.
>
> @Rene: all that talk of maxId functions and random retries etc, etc, is
> complete pooh.
> don'
Op 2/3/10 12:19 AM, Ashley Sheridan schreef:
> On Wed, 2010-02-03 at 00:21 +0100, Rene Veerman wrote:
>
>> the auto_increment sytnax is not uniform across servers, is it?
>>
>> On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan
>> wrote:
>>
>>> I saw it happen on a site that was getting only about
Lol, damn iPod corrections. The app designers is what was meant.
Bastien
Sent from my iPod
On Feb 2, 2010, at 8:41 PM, Robert Cummings
wrote:
Phpster wrote:
Yep, love those race conditions. We have them all over the app cuz
the app ciders don't know shit!
Mmmm... apple cider... to cu
On Tue, Feb 02, 2010 at 11:19:29PM +0100, Rene Veerman wrote:
> oh, on using adodb.sf.net and 0-overhead for jumping between mysql and
> postgresql;
>
> keep all your queries to as simple & early-standard sql as possible.
> the auto_increment incompatibilities can be circumvented with a
> relativ
Robert Cummings wrote:
*snip*
Einstein I believe said something along the lines of
"A smart person solves a problem.
A wise person avoids it in the first place"
Might not have been Einstein, but anyway ...
Do you mean the following quote?
The difference between a smart person and a wise
Michael A. Peters wrote:
Robert Cummings wrote:
Rene Veerman wrote:
eh thats "randomize the timing of the retry attempt"..
On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman wrote:
and after the sleep(rand(1,3)) it might need a short loop like this;
$rnd = rand(1,9); $a=0;
for ($i=0; $i<$rn
Robert Cummings wrote:
Rene Veerman wrote:
eh thats "randomize the timing of the retry attempt"..
On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman wrote:
and after the sleep(rand(1,3)) it might need a short loop like this;
$rnd = rand(1,9); $a=0;
for ($i=0; $i<$rnd; $i++) { $a++ }
to furt
Rene Veerman wrote:
On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan
wrote:
The problem is where 2 people choose the same instant to perform an
action on your site that inserts a record into your db. The db engine
inserts them one after the other, and then responds about the max(id) to
your PH
Phpster wrote:
Yep, love those race conditions. We have them all over the app cuz the
app ciders don't know shit!
Mmmm... apple cider... to cure what ails you or at least get you drunk
enough to not care about the horrible race conditions >:)
Cheers,
Rob.
--
http://www.interjinn.com
Applica
Rene Veerman wrote:
On Wed, Feb 3, 2010 at 12:35 AM, Ashley Sheridan
wrote:
It's the reason transactions exist, to prevent things happening like this.
When you have two actions where one is dependent on the other, unless you
have a way to tie them together so that they can't be broken, you run
Rene Veerman wrote:
On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan
wrote:
The problem is where 2 people choose the same instant to perform an
action on your site that inserts a record into your db. The db engine
inserts them one after the other, and then responds about the max(id) to
your PH
Rene Veerman wrote:
eh thats "randomize the timing of the retry attempt"..
On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman wrote:
and after the sleep(rand(1,3)) it might need a short loop like this;
$rnd = rand(1,9); $a=0;
for ($i=0; $i<$rnd; $i++) { $a++ }
to further randomize the retry
Rene Veerman wrote:
i haven't had the pleasure yet of writing for sites that generate so many
hits/sec that
they'd update the max value of any table at exactly the same time.
i usually ask for the max value about 2 milliseconds before doing the
insert.
And if the insert fails, i can auto-retry v
Good lord that is exacty the same logic applied in our app. It only
takes about 100 users to create the issue.
Bastien
Sent from my iPod
On Feb 2, 2010, at 6:05 PM, Rene Veerman wrote:
i haven't had the pleasure yet of writing for sites that generate so
many
hits/sec that
they'd update t
Yep, love those race conditions. We have them all over the app cuz the
app ciders don't know shit!
Bastien
Sent from my iPod
On Feb 2, 2010, at 5:46 PM, Ashley Sheridan
wrote:
On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote:
function getMax($table, $field)
If I saw this sort
On Wed, Feb 3, 2010 at 12:35 AM, Ashley Sheridan
wrote:
> It's the reason transactions exist, to prevent things happening like this.
> When you have two actions where one is dependent on the other, unless you
> have a way to tie them together so that they can't be broken, you run the
> risk of col
On Wed, 2010-02-03 at 00:31 +0100, Rene Veerman wrote:
> On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan
> wrote:
>
> > The problem is where 2 people choose the same instant to perform an
> > action on your site that inserts a record into your db. The db engine
> > inserts them one after the ot
On Wed, Feb 3, 2010 at 12:18 AM, Ashley Sheridan
wrote:
> The problem is where 2 people choose the same instant to perform an
> action on your site that inserts a record into your db. The db engine
> inserts them one after the other, and then responds about the max(id) to
> your PHP script. Then,
On Wed, 2010-02-03 at 00:21 +0100, Rene Veerman wrote:
> the auto_increment sytnax is not uniform across servers, is it?
>
> On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan
> wrote:
>
> > I saw it happen on a site that was getting only about 3000 hits a day. It
> > just takes the right combina
On Wed, 2010-02-03 at 00:17 +0100, Rene Veerman wrote:
> and after the sleep(rand(1,3)) it might need a short loop like this;
> $rnd = rand(1,9); $a=0;
> for ($i=0; $i<$rnd; $i++) { $a++ }
>
> to further randomize the retry attempt..
>
>
> On Wed, Feb 3, 2010 at 12:05 AM, Rene Veerman wrot
the auto_increment sytnax is not uniform across servers, is it?
On Wed, Feb 3, 2010 at 12:11 AM, Ashley Sheridan
wrote:
> I saw it happen on a site that was getting only about 3000 hits a day. It
> just takes the right combination of circumstances and it all goes pear
> shaped. You really should
eh thats "randomize the timing of the retry attempt"..
On Wed, Feb 3, 2010 at 12:17 AM, Rene Veerman wrote:
> and after the sleep(rand(1,3)) it might need a short loop like this;
> $rnd = rand(1,9); $a=0;
> for ($i=0; $i<$rnd; $i++) { $a++ }
>
> to further randomize the retry attempt..
>
>
and after the sleep(rand(1,3)) it might need a short loop like this;
$rnd = rand(1,9); $a=0;
for ($i=0; $i<$rnd; $i++) { $a++ }
to further randomize the retry attempt..
On Wed, Feb 3, 2010 at 12:05 AM, Rene Veerman wrote:
> i haven't had the pleasure yet of writing for sites that generate
On Wed, 2010-02-03 at 00:05 +0100, Rene Veerman wrote:
> i haven't had the pleasure yet of writing for sites that generate so many
> hits/sec that
> they'd update the max value of any table at exactly the same time.
>
> i usually ask for the max value about 2 milliseconds before doing the
> inser
i haven't had the pleasure yet of writing for sites that generate so many
hits/sec that
they'd update the max value of any table at exactly the same time.
i usually ask for the max value about 2 milliseconds before doing the
insert.
And if the insert fails, i can auto-retry via a wrapper function
On Tue, 2010-02-02 at 23:19 +0100, Rene Veerman wrote:
> function getMax($table, $field)
If I saw this sort of code I'd be appalled! It's possibly the worst way
to get the auto increment value. You won't notice it testing the site
out on your own, but all hell will break loose when you start get
oh, on using adodb.sf.net and 0-overhead for jumping between mysql and
postgresql;
keep all your queries to as simple & early-standard sql as possible.
the auto_increment incompatibilities can be circumvented with a
relatively simple
function getMax($table, $field) {
in adodb, you'd loop through
On Tue, Feb 02, 2010 at 01:15:22PM -0800, Daevid Vincent wrote:
> > -Original Message-
> > From: Lars Nielsen [mailto:l...@mit-web.dk]
> > Sent: Tuesday, February 02, 2010 12:24 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] database abstraction laye
> -Original Message-
> From: Lars Nielsen [mailto:l...@mit-web.dk]
> Sent: Tuesday, February 02, 2010 12:24 PM
> To: php-general@lists.php.net
> Subject: [PHP] database abstraction layer
>
> Hi List
>
> I am trying to make a Database Abstraction Layer so
On Tue, Feb 02, 2010 at 09:23:47PM +0100, Lars Nielsen wrote:
> Hi List
>
> I am trying to make a Database Abstraction Layer so I can which the DB
> of my application between MySQL and Postgresql. I have been looking at
> the way phpBB does it, and it seems that it is only then php-functions
> wh
i'm a fan of adodb.sf.net, which i've used with both postgresql and mysql.
On Tue, Feb 2, 2010 at 9:23 PM, Lars Nielsen wrote:
> Hi List
>
> I am trying to make a Database Abstraction Layer so I can which the DB
> of my application between MySQL and Postgresql. I have been looking at
> the way ph
Lars Nielsen wrote:
Hi List
I am trying to make a Database Abstraction Layer so I can which the DB
of my application between MySQL and Postgresql. I have been looking at
the way phpBB does it, and it seems that it is only then php-functions
which are different. The SQL seems to be the same.
Is
Lars Nielsen wrote:
Hi List
I am trying to make a Database Abstraction Layer so I can which the DB
of my application between MySQL and Postgresql. I have been looking at
the way phpBB does it, and it seems that it is only then php-functions
which are different. The SQL seems to be the same.
Is
Lars Nielsen wrote:
Is it save to assume that I can use the same SQL, or should i make some
exceptions?
Standard SQL should work across all SQL servers with only a few
exceptions (for example, MySQL doesn't support full outer joins.)
Anything that has to do with server administration, howeve
Hi List
I am trying to make a Database Abstraction Layer so I can which the DB
of my application between MySQL and Postgresql. I have been looking at
the way phpBB does it, and it seems that it is only then php-functions
which are different. The SQL seems to be the same.
Is it save to assume that
"Luke Woollard" <[EMAIL PROTECTED]> wrote... :
> I once read a great article in the first or second issue of
> http://www.phparch.com/ on database abstraction layers. At which point I
> used the tutorial as a starting point for creating a very similar structure
> I named dbWave. There are only mi
I once read a great article in the first or second issue of
http://www.phparch.com/ on database abstraction layers. At which point I
used the tutorial as a starting point for creating a very similar structure
I named dbWave. There are only minor differences and a postgresql driver is
now included f
e-
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, March 08, 2002 5:39 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] Database abstraction layer oci
> > >
> > >
> > >
> > > Hi everybody.
> &g
angelism
> http://www.openlinksw.com/virtuoso/whatis.htm
> OpenLink Virtuoso Internet Data Integration Server
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, March 08, 2002 5:39 AM
> > To: [EMAIL PROTECTED]
&
March 08, 2002 5:39 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Database abstraction layer oci
>
>
>
> Hi everybody.
>
> I would like your opinion on the Database Abstraction Layer you prefer (I
> will use it with Oracle 8i)
> I know that there is Metabase end Pear
Hi everybody.
I would like your opinion on the Database Abstraction Layer you prefer (I
will use it with Oracle 8i)
I know that there is Metabase end Pear DB
What's your opinion on both or others ?
Laurent Drouet
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: htt
43 matches
Mail list logo