Forums

General Betting

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
Feck N. Eejit
25 Jan 12 12:35
Joined:
Date Joined: 10 Jan 02
| Topic/replies: 8,841 | Blogger: Feck N. Eejit's blog
I'm using c++ builder and Devart MyDAC components to access a MySQL form database called Formbook. I want to have two seperate programmes running.

Prog 1 will be retreiving a list of my latest odds from Formbook, placing bets through the API and updating Formbook with bets placed so far and P/L figures for each runner.

Prog 2 will allow me to browse through Formbook, view P/L figures for any race, tweak odds for any race as well as update a Formbook table that will be accessed by Prog 1 to receive messages (e.g. suspend betting).

Is it as simple as setting up a TMyConnection to Formbook in each programme? The two programmes will obviously be using the database at the same time so does the MySQL server take care of everything for me or is there anything specific I've got to do within C++ Builder.

I've got no experience of working with threads.
Show More
Loading...
Report DStyle January 25, 2012 1:32 PM GMT
locking will dealt with by mySQL so your updates from the two different programs will be serialised. readig is obviously not a problem.

you probably need to have a think about the impact of concurrent updates though from the data point of view though.
Report Feck N. Eejit January 25, 2012 1:41 PM GMT
Thanks DStyle. I'm not sure what you mean in your last sentence. The odds aren't going to change by that much and Prog 1 would only be betting where there was room for error in the odds so I wouldn't have a problem with it working with out of date odds. Where the changes were going to be significant I'd suspend betting on that race until I'd changed the odds. Is that the kind of thing you're meaning?
Report DStyle January 25, 2012 2:06 PM GMT
what i meant, without going into the detail of precisely how your program will work, is if you have two things writing to the same row, you need to think about whether there are any dependencies or not. for example, if prog A writes X to row 1, should any more updates be permitted from any other program. generally it means you might need to start querying data immediately before conditionally updating.
Report Feck N. Eejit January 25, 2012 2:19 PM GMT
I can't think of any problems DStyle. The two progs will be writing to the same table (although I could make it otherwise) but each will be writing to a separate group of fields with neither group dependent on the other. Thanks for your help.
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com