Trust ID PBCEX logo 300x102

Global counter value not unique

5 years 6 months ago
Mark Vinkx
Senior Boarder
Senior Boarder
Posts: 52
More
Topic Author
Global counter value not unique #6318
My setup is cardexchange 9.3.0.37 SBS using printserver

I use a global counter to create a unique barcode on the cards I print
I also store the global counter in a database field after printing.
Is see now duplicates in the global counter field. This occured after restarting the printserver and cardexchange

How is the global counter stored. Is it in a config file. What do I have to to care of to make sure it is always incremented
5 years 6 months ago
Craig Bechelli
Administrator
Administrator
Posts: 624
More
Global counter value not unique #6325
Hi Mark,

Unfortunately global counters cannot be used safely within an SBS environment with shared data folders. When running CardExchange in read-only mode, the global-counter updates are never saved.

Global counters with multiple users are hard to implement without relying on a database that handles the multi-user aspect of it. We normally recommend to use the database functionality for generating the unique numbers (auto-number fields, triggers that call stored procedures etc..).
If that is not an option for the customer, it is possible to create a plug-in that creates the number. The plug-in could for example call a stored procedure that returns the number or read the number from a table that has a read trigger that updates the number automatically when read.

If you would like to look at the plugin option you would need to contact our sales department so we can investigate and offer a quotation for the work.

Regards,
Craig

Craig Bechelli
CardExchange Solutions Support Team

"If you define the problem correctly, you almost have the solution." (Steve Jobs)
5 years 6 months ago
Mark Vinkx
Senior Boarder
Senior Boarder
Posts: 52
More
Topic Author
Global counter value not unique #6330
Auch ! Our customer just went production with the global counter.
I locked the config directory to the printserver so he can update the counter and I have some time to redesign the setup to use a database field
5 years 5 months ago
Craig Bechelli
Administrator
Administrator
Posts: 624
More
Global counter value not unique #6331
Hi Mark,

As long as you have only 1x PC printing and that has access tothe Data folder in configuration mode then it should be ok, it would still be good to look at the options available to handle this on the database side if possible though.

Let me know how you get on.
Craig

Craig Bechelli
CardExchange Solutions Support Team

"If you define the problem correctly, you almost have the solution." (Steve Jobs)
5 years 5 months ago
Mark Vinkx
Senior Boarder
Senior Boarder
Posts: 52
More
Topic Author
Global counter value not unique #6371
I have made a setup that is safe when using one printclient but does not depend on the lock of the configuration directory

I made a logtable and a globalcountertable
A storage item configured to alway insert writes an entry after printing in the logtable
The insert trigger on the logtable increases a number in the globalcountertable.
The number from the globalcountertable is used for the barcode on the card