[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem With Saving Parts



Hi Richard,

I hope you meant version 1.2.18 (not 2.1.18) as we are waiting for 1.3 to be release at the moment! :-) , :-P

>From what you have just told me I would like to refer this to Chris T.
With the fact that you have
  • done a number of upgrades of LSMB
  • have a partial karmic upgrade done
Some extreme expert advise will be required.

run
    P=$(grep '[^#].*Bport' /usr/local/ledgersmb12/ledgersmb.conf | sed 's/.*=.//');
    grep -l "$P" /etc/postgresql/8.[0-9]/main/postgresql.conf | cut -d/ -f4
This will return 8.2 or 8.3 depending on the port numbers LSMB and Postgres are configured for
Also running
    pg_lsclusters
should return something like this....
  Version Cluster   Port Status Owner    Data directory                     Log file
  8.3     main      5432 online postgres /var/lib/postgresql/8.3/main       /var/log/postgresql/postgresql-8.3-main.log
You can compare the port with what was stored in P (from the above command P=$(grep..........)   by running
  echo "LSMB Port =$P"

If you could double check your version numbers and complete the summary below.
Correcting everything, especially the bits in red. Set the color to black when done.
OS Version:                  Ubuntu 9.04 with a failed 9.10 upgrade
PostGres Version:            8.????
LSMB Version:                Started at 1.2.8
                             Currently at 1.2.18  (upgraded over time, with no DB changes)
Number of Vendors:           21
Number of Parts:             ??????
Number of Vendors per Part:  1
Number of DB Records:        Problem started arround 20,000
                             Currently arround ???????

Once Chris (or another guru) has helped you sort the DB
or they would like you to complete the Ubuntu Upgrade
Email me at info at sbts .d.o.t. com .d.o.t. au
or call on +61 437 286 200 (australia)
and I can provide assistance with the upgrade as it is a part of what the business does.

time for sleep (1:30am) will monitor the list all day tomorrow.

Regards
David Godfrey



beamends wrote:
On Wed, 2009-12-09 at 22:28 +0800, David Godfrey wrote:
  
Hi Rich and Beamends,

I would be hesitant to suggest this path without chatting with Chris T
or one of the other developers first.
The code is, I think, correct.
I suspect that there is a problem elsewhere, most likely with the
underlying database.

What version are you running, was the DB setup for this version from
scratch, or was the DB migrated from an earlier version?
Also do you have any modified code in LSMB?
I guess it would make sense to ask what version of what OS you are
running and also what version of postgresql.

These answers may help the experts answer more quickly.

One more question, how many items do you have in inventory?

I have about three thousand items in mine, with no problems and know
that there are others with many more.
Until now I have not heard of any reports about this problem.

One thing I have noticed though, if you try and define multiple "Make
and Model" entries for a part you will always get errors (I think they
are "duplicate key" errors, but it has been a while).
Never had a problem with multiple vendors though.

Regards
David G

    

Fair comment... 

it's 

LSMB 2.1.18
Postgres 8.2 (might be 8.3 though..... see below)
Ubuntu 9.04  and a bit (see below)

Postgres has only ever been installed for use with LSBM, the upgrade to
Ubuntu 9.10 didn't go too well, hence the "and a bit"! Postgres 8.2 and
8.3 are installed - I'm not sure how to find out which one is actually
being used. LSMB stared out at about 2.1.8 or something and has been
upgraded several times. It's Apache2 and the latest Firefox (which is a
bit flakey, but not relevant I think). 

However, I've always had this problem (but not so bad) since the dbase
got past about 20,000 lines (or records if you prefer) - it's just
started getting really irritating now, so I'm pretty sure it's a
LSMB/Postgres interaction problem related to the size of the dbase.


Cheers
Richard 

  
Rich Shepard wrote: 
    
On Wed, 9 Dec 2009, beamends wrote:

  
      
"DBD::Pg::st execute failed: ERROR: duplicate key violates unique
constraint "partsvendor_pkey" at LedgerSMB/IC.pm line 529.

Error!

INSERT INTO partsvendor
(vendor_id, parts_id,
partnumber, lastcost,
leadtime, curr)
VALUES (?, ?, ?, ?, ?, ?)
ERROR: duplicate key violates unique constraint "partsvendor_pkey"
"
    
        
Richard,

   I'm not a perl coder, nor a LSMB developer, but I've encountered this type
of SQL error in my approximate reasoning models. The problem is the existing
key and the solution is to write the SQL statement as:

   INSERT or REPLACE into ...

   If the primary key does not exist the new row is inserted; else if the primary
key exists, the column attribute values are replaced with those in the
statement.

   An alternative approach to accomplishing the same thing is to first "DELETE
from <tablename> where ..." followed by the INSERT statement.

HTH,

Rich


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users

  
      
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users
    


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users