As Virginia's legislators convened for their noon-time sessions last Wednesday, Sen. Dudley J. Emick (D-Botetourt) whispered to a reporter, "I hear the second battle of Alexandria is going to take place this afternoon."

The first battle of Alexandria was the easy takeover of the city by Union troops in the early days of the Civil War.

The second battle, to which Emick referred, was the election by House of Delegates Democrats of Albert H. Grenadier over once powerful Democratic House leader James M. Thomson for a circuit court judgeship in the Northern Virginia city.

The House Democratic caucus that decided the judgeship produced a 41-to-33 victory for Grenadier and ended two months of bitter campaigning that began in Alexandria and spread to the state Capitol.

At week's end House Democrats looked back on Thomson's defeat and agreed that his judicial candidacy fell victim to the very partisan -- and often provincial -- rules that he had espoused as majority leader.

If anything, the legislators say that Thomson's defeat has strengthened what Democratic legislators long have assumed was their "right" to name their hometown judges.

Virginia Republican legislators have long been angry over the judge-selection process which excludes them. Lately their cries had been joined by other court reformers who would go further than many Republicans and take all politics out of the process. These critics would like Virginia to have nonpartisan panels review judicial candidates much like those President Carter had advocated for the federal judiciary.

But the advocates of change seem to have suffered a setback last week in their efforts to push aside the role of Democratic legislators. For on the same day that Thomson's old legislative friends failed in their bid to give him a judgeship, the Assembly made judges out of another former legislator and the law partner of a state senator, even though both lacked the endorsement of their local bar associations.

Those new judges had one thing going for them that Thomson did not -- the backing of their local state legislators.

The Thomson-Grenadier contest pitted the unwritten rule giving Democratic legislators power to name judges in their districts against a tradition of honoring former legislator-lawyers with what usually become lifetime judicial appointments. "Old delegates never die," goes a Richmond saying, "they just become judges."

In last week's Alexandria fight, the city's two Democratic delegates, Richard R. G. Hobson and Elise B. Heinz, favored Grenadier and they bluntly told their fellow Democrats in a Wednesday caucus that the integrity of the appointment system was at stack. They prevailed.

"I won't mess with your judge if you don't mess with mine," Hobson told the caucus. "I have adhered to that principle as long as I have been here and I ask you to adhere to it to day."

Heinz took the edge off Hobson's pragmatic political talk by alluding to the criticisms of Thomson's segregationist record, but in the end, her message was the same. "As long as we agree with each other (in caucus) we can say to our constituents, 'We can elect the judges you want.' If Al Grenadier isn't elected, we can't say that anymore and neither can anyone else," she said.

Legislators said later that Grenadier's endorsement over Thompson by the Alexandria Bar Association and a citizens panel named by Hobson were factors in his selection.

However, assembly rebuffs of bar preferences on judgeships in Portsmouth and on the Eastern Shore on the same day Grenadier was elected left only one principle of Virginia judicial elections intact -- the power of local legislators to name "my judge."

Thomson's defeat reflects the eclipse of a political old guard that began in Alexandria's City Hall politics about 1970, but only recently has extended to the city's legislative delegation.

Hobson and Heinz responded to black and feminist opposition to Thomson in choosing Grenadier. Four years ago, the choice would have been made by Thomson and former Del. Frank E. Mann, his political ally who has since been re-elected mayor.

Alexandria's Republican legislators, Sen. Wiley F. Mitchell Jr. and Del. Gary R. Myers, also favored Grenadier, but as Republicans they played no role in his election.

Hobson acknowledged in an interview that his blunt demand for the right to choose his judge may cost him later. It produced an appointment in Alexandria that he and Heinz believe is sensitive to the community, especially to its black and female residents. However, it may have forfeited any opportunity by Hobson and Heinz to object to the election elsewhere of judicial candidates that have the backing of their legislators.

"I realized I was paying that price," Hobson said. "But I know those who voted for Jim. I don't owe them."

Several legislators said in interviews that memories of Thomson's tough leadership style in Richmond probably cost him votes and memories of his often vitriolic attacks on opponents raised questions about his "judicial temperament."

During his last years in the Assembly, Thomson often left other legislators agape at his blistering partisan attacks on former Gov. Mills E. Godwin for Godwin's resistence to approving state aid for the Washington area's metro system.

Referring to Thomson's speeches Del. J. Samuel, Glassock (D-Saffolk) said: "You sometimes sat there and looked at him and wondered why in the world he did that."

The free-wheeling Thomson-Grenadier contest contributed in the view of some to the slow opening up of judicial elections in the assembly."When I came here 10 years ago, one or a few members said, 'This is the nominee,' and that was all there was to it," Glasscock said.

"Now the court's committees interview the candidates and those interviews are becoming more complete, even though we still have room for improvement."

Hobson and some influential members of the Senate favor creation of an advisory commission to guide assembly choices of judges. The plan has been endorsed by the Virginia State Bar, but it has strong opposition, including Glasscock and the current House majority Leader, A. L. Philpott (D-Henry).

But most legislators seem to agree that, as long as Democrats control the overwhelming ajority of the 140 seats in the assembly there is little reason to expect the legislature to change the process. "I think you'll see this system change when the Republicans get about 35 seats in the House," says Del. Vincent F. Callahan (R-Fairfax), the minority caucus chairman. "The public won't go for election of judges by a majority of 60 to 65 Democrats."