Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.


If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping


Answers may be delayed for posts that do not include sufficient information.

Serial numbering of idno seems broken

Hi!

I have a setup that should assign a unique idno number with each imported image.

The multipart_id_numbering .comf is set up as following (only the relevant part)
formats = {
ca_objects = {
image = {
separator =,
elements = {
object_number = {
type = SERIAL,
minimum_value = 102000,
width = 6,
description = _(Object number),
editable = 1,
table = ca_objects,
field = idno,
sort_field = idno_sort
}
}
},

    __default__ = {
        separator =,

        elements = {
            accession_number = {
                type = FREE,
                width = 30,
                editable = 1,

                description = _(Accession number)
            }
        }
    }

},

It seems to work fine for a while but then the numering starts to loop again and i end up with multiple Idnos that are the same.
Any ide why?
How is the next IDNO calculated and where?

Comments

  • I don't know why this is happening in your case. but there were definitely issues with the numbering system (esp. when used with multiple elements that mixes letters and numbers) that would result in duplicate numbers being issued. Updating to current code will get you these fixes. You also should run "rebuild sort values" under "Maintenance" in the "Administrate" area and see if that helps. The next value in generated by looking at what the last used value is, which in turn relies upon sort operating properly.

  • Thank you for you anwser! Will try to "rebuild sort values" and get back to you.

  • I have the same problem, rebuilt of the sort index doesn't fix it. Is it possible to set the serial number higher inside the database? There is a table ca_multipart_idno_sequences where the last sequence is set.

  • The serial # is set off of the last entry in the table being indexed. There's no specific place to set it as it's derived. I'd look at your configured format and make sure it matched the format of the entries in the database.

  • Still experiencing this issue when importing. It works for maybe 250 images imported and then it restarts from the minimum_value.

  • I just took a look at the table ca_multipart_idno_sequences, there is a field ca_objects with the value 4294967295 which seems to be the last sequenece. Creating a new mark of provenance I get 'LCA_ ', but there are already four entries with the sequence number LCA_4294967296.Trying to set this value up to 4294967296 I get the error message 'Warning: #1264 Out of range value for column 'seq' at row 1'

  • The ca_multipart_idno_sequences table is still maintained but not actually used to generate next in sequence. It'll likely go away in the near future. @krempe Remind me, what version are you running?

  • I run 1.7.5

  • Try updating to 1.7.8

  • I updated to 1.7.8, same problem.

  • Can you send me your multipart_id_numbering.conf file?

  • I deleted the four records with identical sequences LCA_4294967296, now I still get 'LCA_4294967296' as suggestion if I create a new 'mark of provenance'. Looks like the software still doesn't increment the sequence.

  • Why is the sequence number so large?

  • I don't know. If I create a new entity, not a mark of provenance, the next suggested number is LCA_000011723, which looks adequate to the number of records in the database.

  • My multipart_id_numbering.conf:

    formats = {

    Exemplare:

    Soll vor der laufenden Nummer ein weiterer Wert stehen muß dieser mit "Zeichen" abgegrenzt werden,

    sonst Speicherfehler; ohne Praefix: separator =,

    editable = 0: Eintrag ist nicht editierbar

    ca_objects = {
        __default__ = {
            separator =_,
            elements = {
                                praecode = {
                                        type = CONSTANT,
                                        value = LCA,
                                        width = 3,
                    editable = 0,
                                        description = praefix
                                 },
                num = {
                    type = SERIAL, 
                    width = 9, 
                    editable = 0,
                    table = ca_objects,
                    field = idno,
                                        zeropad_to_length  = 9,
                    description = _(Accession number)
                    sort_field = idno_sort
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_object_lots = {
        __default__ = {
            separator =,
    
            elements = {
                lot_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Lot number)
                }
            }
        }
    },
    

    ----------------------------------------------------

    Personen:

    ca_entities = {
        __default__ = {
            separator =_,
            elements = {
                                praecode = {
                                        type = CONSTANT,
                                        value = LCA,
                                        width = 3,
                    editable = 0,
                                        description = praefix
                                 },
                num = {
                    type = SERIAL, 
                    width = 9, 
                    editable = 0,
                    table = ca_entities,
                    field = idno,
                                        zeropad_to_length  = 9,
                    description = _(Accession number)
                    sort_field = idno_sort
                }
            }
        }
    },
    

    ----------------------------------------------------

    Personen (Original):

    ca_entities = {

    default = {

    separator =,

    elements = {

    object_number = {

    type = SERIAL,

    width = 9,

    description = _(Identifier),

    editable = 0,

    table = ca_entities,

    field = idno,

    zeropad_to_length = 9

    sort_field = idno_sort

    }

    }

    }

    },

    ----------------------------------------------------

    ca_object_lots = {
        __default__ = {
            separator =,
    
            elements = {
                lot_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Lot number)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_places = {
        __default__ = {
            separator =,
    
            elements = {
                place_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_occurrences = {
        __default__ = {
            separator =,
    
            elements = {
                occurrence_number = {
                    type = FREE,
                }
            }
        }
    },
    

    Original:

    ca_entities = {

    default = {

    separator =,

    elements = {

    object_number = {

    type = SERIAL,

    width = 9,

    description = _(Identifier),

    editable = 0,

    table = ca_entities,

    field = idno,

    zeropad_to_length = 9

    sort_field = idno_sort

    }

    }

    }

    },

    ----------------------------------------------------

    ca_places = {
        __default__ = {
            separator =,
    
            elements = {
                place_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_occurrences = {
        __default__ = {
            separator =,
    
            elements = {
                occurrence_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_collections = {
        __default__ = {
            separator =,
    
            elements = {
                collection_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_storage_locations = {
        __default__ = {
            separator =,
    
            elements = {
                location_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_object_representations = {
        __default__ = {
            separator =,
    
            elements = {
                representation_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_list_items = {
        __default__ = {
            separator =,
    
            elements = {
                list_item_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_loans = {
        __default__ = {
            separator =,
    
            elements = {
                list_item_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_movements = {
        __default__ = {
            separator =,
    
            elements = {
                list_item_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    },
    

    ----------------------------------------------------

    ca_tours = {
        __default__ = {
            separator =,
    
            elements = {
                list_item_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    }
    

    ----------------------------------------------------

    ca_tour_stops = {
        __default__ = {
            separator =,
    
            elements = {
                list_item_number = {
                    type = FREE,
                    width = 30,
                    editable = 1,
    
                    description = _(Identifier)
                }
            }
        }
    }
    

    ----------------------------------------------------

    }

  • The configuration looks ok to me. How many object records do you have in the database? Are there any records in there with non-conforming identifiers? Because it's using the identifiers in the database to calculate the next-in-sequence number, if there are identifiers in there that don't conform to your LCA_X format you may get incorrect sequences.

  • Can you tell me which table contains the identifiers, so I can check the values? Thanks!

  • ca_entities is the table. Indeed, there are not conform Ids. I'll try to correct them.

  • I can't get rid of the problem that the sequence number LCA_4294967296 is duplicated when I create a new record instead of counting up to LCA_4294967297.
    Checking the SQL table 'ca_object's there are several records with idno = 'LCA_4294967296'.

    Maybe it's an idea to change the idno praefix for objects from 'LCA_' to 'LCAN_' and rebuild the sort index?

  • I just tried it out. After changing the object praefix from 'LCA_' to 'LCAO_' and re-editing the object with ID 'LCA_000988509' the id changed from 'LCA_000988509' to 'LCAO_000988509', the next sequence for a new object record would be 'LCAO_000988510'.

  • Try setting the "sequence_by_type" option in your numbering configuration.

  • I checked out the generating of the idno in the plugin ./app/lib/IDNumbering/MultipartIDNumber.php
    In line 712, function 'getSequenceMaxValue', the table' 'ca_multipart_idno_sequences' is checked for generating the number part of
    the idno, concerning to the so called stub in ca_multipart_idno_sequences, which is the chosen praefix for idno.
    If the idno returned by getSequenceMaxValue is higher than the actual idno this value is used for generating the idno.
    After adapting the record in ca_multipart_idno_sequences the idno was generated as espected. Additionaly I hardcoded the variable
    $vs_stub so that the idno search gehts only ids beginning with 'LCA_'. Looks like it works now.

  • Can you send me your code to look at?

  • Hi! If I delete some objects, their idno stay in the 'ca_multipart_idno_sequences'. I cant get rid of it and CA cant use those idnos again. It only works when I manualy delete them in sql.
    But my question is - is there any possibility to index that table in order to have only existing idno numbers (without deleted ones)? [1.7.8]

  • It's not possible now, by design. Reusing numbers is usually a bad idea. We can certainly add it as an option. If you want it please file a JIRA for it at https://collectiveaccess.atlassian.com

  • Thank you for your quick answer. "By design" - and its all clear now. By the way, I remember that in the past on DEV , I have cleared all the records from table ca_multipart_idno_sequences and it was able to rebuild it somehow (I use two SERIALS in IDNO so there was lots of testing).

  • If you want a setting to easily reuse numbers, we can add it...

Sign In or Register to comment.