These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Transaction API transactionID / Journal API refID

Author
Kybernetes Moros
Itsukame-Zainou Hyperspatial Inquiries Ltd.
Arataka Research Consortium
#1 - 2013-09-05 13:53:38 UTC
I'm logging (corporate) transactions and journal entries into a table of a database I'm working on, but I'm unsure how the transactionID and refID are generated. I know that both are unique within their own kind (i.e. would work as the primary key of a table exclusively containing transaction data or journal data), but are they unique between each other?

In other words, could the values for transactionID and refID ever overlap to produce distinct transaction and journal entries with the same ID? Just lets me know if I can save some hassle and throw them both in the same table without any additional flagging.
Hagen Stein
Biotronics Inc.
#2 - 2013-09-05 16:10:11 UTC  |  Edited by: Hagen Stein
Kybernetes Moros wrote:
I know that both are unique within their own kind


Short answer: no

Long answer: depending on what kind of transaction/journal data you store, they might be unique. For transactions, both the buy and sell transaction share the same transactionID. If you sell to yourself, the API provides you with two result sets which happen to have an identical transactionID. Same goes for refID in journal, ofc.

Quote:

In other words, could the values for transactionID and refID ever overlap to produce distinct transaction and journal entries with the same ID? Just lets me know if I can save some hassle and throw them both in the same table without any additional flagging.


The above basically answers this question, too. Although logic dictates that journal IDs run ahead of transaction IDs, they're generated seperately from each other and therefore in theory might conflict. So, do yourself a favor and store the data in two different tables.
Kybernetes Moros
Itsukame-Zainou Hyperspatial Inquiries Ltd.
Arataka Research Consortium
#3 - 2013-09-05 17:11:19 UTC
Ah, cheers; I didn't realise that the same transaction on both ends would have the same ID, derp. Thanks for pointing that out.