[ts-gen] questions on journal tables

Nils Gebhardt mail at ngebhardt.de
Fri May 1 15:27:18 EDT 2009


Hi there, 

I have a few more or less unrelated questions (of low priority) on order
journaling. 
 
I find the order journaling extremly useful. However, sometimes I am
experiencing difficulties to catch all messages. 
I observered incomplete updates especially of the table OrderStatus; for
example  'Submitted' of an record missing, then 'Filled' coming in.  
All other tables appearently were not affected, cancel via CreateEvent
always possible and OrderReport appearently complete as also
ActiveOrder. 

For one occasion I observed shim to produce the following output: 

Oreq:  0x7f37c96c9660  0x7f381acd1dc0  0x7f381acc6738
Oreq:  0x7f37c974b8d8  0x7f381acd1dc0  0x7f381acc6738

Problem: 414 mysql query evaluation failed
Error 1062 (23000): Duplicate entry 'exit2009_0430_123253' for key 2
call OrderUpdate('exit2009_0430_123253', 2, 48824, 78, 1, 8, 142,
'test_e', null, 'create', 'LMT', 5, 0.0, 123, NULL, NULL, NULL);
Problem: 417 %s tuple not found following insert
Oreq:  0x7f37c7cafd50  0x7f381acd1dc0  0x7f381acc6738

----%---


Is there something like an timeout parameter which could be tuned to
ensure that all OrderStatus messages are catched?


Related to this set of tables: 
Earlier I was using columns order_tag, acc, client_id as primary key for
joins on these tables. However, acc seems to have a 
completly different meaning as in ActiveOrder - where acc is simply the
account number as it seems.    
I am not quite shure how order_tag is generated - but I get not quite
the expected result if I do for example 

select CreateEvent.time, CreateEvent.oid, PrderStatus.filled,
OrderStatus.avg_fill from CreateEvent, OrderStatus
 -- select * from CreateEvent, OrderStatus 
  where OrderStatus.client_id = CreateEvent.client_id
  AND OrderStatus.order_tag = CreateEvent.order_tag
  AND OrderStatus.acc = CreateEvent.acc
  AND status = 'Filled';

adding 
AND date(OrderStatus.time)= date(CreateEvent.time)

makes the key to join on unique - at least on my data in this example. I
would be curious to know what is the rule that generates order_tag and
how do I compose  unique key from it. 


The meaning of OrderResult is not quite clear to me, especially: what is
the update frequence of this table?



Thanks

Nils



More information about the ts-general mailing list