@Override
    public void update(Observable o, Object arg) {
        if(DEGUB)System.out.println("In update(Observable o, Object arg)");
        
        LocationItem li = (LocationItem)o;
        int row = locationItemList.indexOf(li);
        
        System.out.println("LocationsTableModel.update(ToolID:"+li.getCode()+")");

        try (Statement stmt = con.createStatement();
             ResultSet rs = stmt.executeQuery("SELECT COUNT(*) FROM Locations WHERE Code = '"+li.getCode()+"'");)
        {
            //Not Thread save, not considered an issue while SQLite is db
            
            rs.next();
            if ((rs.getInt(1)) == 0) { //Key not foud in db
                insertLocationItem(li);
            } else {
                if (getMode() == MODE_INSERT) {
                    JOptionPane.showMessageDialog(null,
                        "Location Code must be unique.",
                        "Error",
                        JOptionPane.ERROR_MESSAGE);
                    
                } else {
                    updateLocationItem(li);
                }
            }
            
        } catch (SQLException ex) {
            System.err.println(ex.getClass().getName() + ": " + ex.getMessage());
        }
        
        //Fire table row update notification to table.
        fireTableRowsUpdated(row, row);
        
    }