IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Yup. Didn't find that though.
Saw lots of people whining about coming from mysql where is has
something built in for this.

Hacked around it already.

lock table
do insert
select max(id)
commit - which I BELIEVE unlocks table
disconnect - which I'm sure unlocks table.

I'm using Sun Grid Engine to control my print spooling. I've got dozens of
jobs associated with the spooling task, all of which have lots of logging
to individual log files / emails to user.

So I'm telling SGE to execute my logging scripts before and after each job,
which should allow reporting to come off the centralized database rather than
track stuff through the many log files.

So the before task creates the log entry, while the after task has to update it.
New my, that's a big hammer you have there...
Yes, the 'commit' does unlock the table. It tells the database server to 'make it so'. 'rollback' undoes whatever you did, provided you haven't already done a commit.

The lock ... select max... is really a brute force and ignorance (in the non-pejorative sense) approach. It will kill you on a multi-user transaction system. A data warehousing system can probably get away with it, but it is still poor form. Take a few minutes to implement the method Ben pointed to. You'll save yourself mysterious headaches later.
Have fun,
Carl Forde
New Oh, I'll modify it
But the current way would NOT be a killer.
The id field is indexed. So select max is not doing a table scan.
Log entries instaneous from my timing point of view.
The acual insert/updates might be 20-40 an hour.
Each less than a second.

So my hammer is not dangerous, it is just not the best way.
     Postgres / serial datatype / perl question - (broomberg) - (9)
         Getting closer - (broomberg)
         Did you google? - (ben_tilly) - (4)
             Yup. Didn't find that though. - (broomberg) - (2)
                 my, that's a big hammer you have there... - (cforde) - (1)
                     Oh, I'll modify it - (broomberg)
             SELECT currval - (altmann)
         OK, now I want logging suggestions - (broomberg) - (2)
             A thought on Q#1 only, because... - (CRConrad) - (1)
                 (l)users don't run command line loggers - (broomberg)

Firecracker!
75 ms