Symptom:
2018-10-29 20:06:57,680 ERROR [main] [ch.algotrader.starter.ServerStarter] Object [id=205] was not of the specified subclass [ch.algotrader.entity.SubscriptionImpl] : loaded object was of wrong class class ch.algotrader.entity.PositionImpl
org.hibernate.WrongClassException: Object [id=205] was not of the specified subclass [ch.algotrader.entity.SubscriptionImpl] : loaded object was of wrong class class ch.algotrader.entity.PositionImpl
Because PropertyHolders
use Hibernate Union-Subclass
strategy, Id's of different PropertyHolder
tables may not overlap. When Entities are saved through AlgoTrader unique Id's will be enforced by Hibernate. But when saving rows in the database directly (within the tables strategy, position, subscription or order_preference) one has to manually ensure there are no overlapping Ids.
The following SQL script can be used to check whether a certain Id is already in use:
select id from strategy union select id from position union select id from subscription union select id from order_preference;
Comments
0 comments
Please sign in to leave a comment.