As a schoolmaster he soon made his mark, teaching principally mathematics through the school to Higher Grade. From 1930 to 1937 he was master-in-charge of Dundas House, where James, and Addie his wife, gained the lasting affection of their boys. Thereafter they moved to a house of their own design surrounded on three sides by the Academy New Field, where James developed his life-long interest in bee-keeping. In 1940 he realised a cherished ambition in assuming the headship of the school Mathematics Department. Though staff and boys were depleted by the effects of war, that period became one of achievement, with James successfully sharing in work of "A" level and "Scholarship" standard. He also became responsible for much intricate administrative detail which grew increasingly complex after the war. "I like doing it" was his constant rejoinder to offers of help. In time, unfortunately, abdominal trouble developed, which led to a major operation in October 1950, and to James's retirement in 1951.
For many years he was a deacon at Inverleith Church. In 1932 he was elected to Fellowship of this Society. Holidays were spent usually at a rustic cottage near Kingskettle, in Fife. From 1927 until his operation he was Hon. Treasurer of the Edinburgh Mathematical Society. Professor Sir Edmund Whittaker's glowing tribute, duly recorded in the minutes, alluded to Mr Lockhart's work on the accounts as "a labour of love". Thus also could aptly be described James's motivation in tackling the other varied assignments which filled the final decade of his school career. Their successful completion was only made possible by outstanding qualities of mind and character.
In retirement at Balmony, Glendevon, he continued to assist for a time with the Academy Development Appeal, and for years he and Addie were active in local and kirk affairs, while caring for garden and beloved bees. Visitors were sure of a warm welcome with a glass of mead, or jar of honey. Heart trouble found them both in hospital in 1966, and thereafter James owed much to his wife's devoted care. Shortly before Christmas 1968 he had the misfortune to break a leg and died, following operations in Glenfarg Hospital, on January 27, 1969.
Untrained as a teacher, he had been a mainstay of mathematical teaching at the Academy for more than a generation. Pupils remember him for skill in pacing instruction, for meticulous nailing of error, for illuminating alternative solutions, for tireless patience and invariable clarity of mind. Colleagues recall the ready application of his outstanding qualities to their own problems, his pawky good humour with never a trace of malice, his enjoyment of a round of golf in all weathers, and in grateful retrospect, many a glass of mead or pot of honey.
Addie has not long survived him. Herself in hospital at Auchterarder at the time of James's death after a brief convalescence she returned to Balmony against doctor's advice in order to "clear up", but later returned to hospital, where she died on July 27, 1969.