United Virginia Bankshares Inc. and First Virginia Bankshares Corp. yesterday both reported record quarterly earnings as UVB showed an 81 percent increase over the 1977 period and First Virginia showed a 22 percent increase for the second quarter of 1978.

E. C. Ernst Inc., a large locally based electrical contracting firm, reported a loss of about $3 a share for the year ended March 31. The company asked the American Stock Exchange to delay trading of its stock.

Ernst said the loss arose principally from "a recent reevaluation of contracts" by its auditors, Richard A. Eisner & Co., in connection with its year-end audit. Ernst was informed by its auditors Friday that "reevaluation was required for certain contracts in order to account for them on the basis of cost incurred without the inclusion of estimated profit."

The company said the reevaluation also would affect fourth-quarter earnings. The company said it has submitted new prices for some contracts which have been substantially modified. "When such prices are agreed upon, the excess overcost will be included in income" in future fiscal years, the company said. Its annual meeting, scheduled for July 26, will be rescheduled when the company completes its fiscal 1978 financial statements.

United Virginia, the state's largest banking institution, topped $3 billion in assets as its second quarter operating earnings reached a record $6.7 million ($1.23 a share), up 81 percent from the $3.7 million (68 cents) reported a year ago.

UVB's income before securities transactions rose 71 percent during the first-half, to $12.1 million ($2.24 a share) from $7.1 million ($1.31) a year ago.

Chairman and chief executive officer Joseph Jennings said the record earnings reflect "continued good growth in loans and financing, especially in the commercial and installment loan areas, and increased short-term rates."

First Virginia Bankshares Corp., the largest bank holding company in Northern Virginia had record second-quarter earnings of $2.9 million (28 cents a share) compared with $2.4 million (23 cents) last year, an increase of 22 percent.

Income before securities transactions for the first-half was $5.6 million (53 cents a share), an increase of 23 percent over last year's $4.5 million (43 cents.)

Chairman Ralph Beeton said a rapid growth in consumer installment loans accounted for a significant portion of the improved earnings.

Federal National Mortgage Association, commonly known as Fannie Mae, reported yesterday second quarter earnings of $58.7 million ($1.09 a share) compared with $41.2 million (78 cents) a year ago.

Fannie Mae, a corporation created by the government to support a secondary market for home mortgages, reported first-half earnings of $110.7 million ($2.05 a share) compared with $84.0 million ($1.64) a year ago.

Atlantic Research Corp. of Alexandria reported second quarter earnings of $365,000 (69 cents a share), an increase of 205 percent over last year, on sales of $11.6 million.

The employe-owned high-technology firm reported first-half earnings of $669,000 ($1.33 a share) on sales of $21.5 million compared with $465,000 (97 cents) on sales of $15.9 million in the first-half of 1977.

Atlantic Research is involved in rockets and gas generators, telecommunications, data communications, test equipment and chemical research techniques.