D.C. corrections director James F. Palmer arrived at work Sept. 24 feeling good about his department's handling of a demonstration by inmates at the District's Lorton Reformatory in Fairfax County the day before. Chatting with his aide, LeRoy Anderson, Palmer commented that things had gone well.

"Except," Anderson noted, "for the shotguns."

"What shotguns?" asked Palmer.

Palmer had been at a conference at the Washington Convention Center while the riot was going on, and his subordinates could not reach him that night to tell him that 13 prisoners had been wounded, the subordinates told police investigators later. Palmer insisted that his paging device never sounded, but the damage was done in either case.

An embarrassed Mayor Marion Barry ordered Palmer to discipline three deputies and apologize to authorities in Fairfax County, who had not been notified while the violence was occurring in their back yard.

The incident was not an isolated one for the D.C. Department of Corrections, which has experienced a string of difficulties under Palmer, a longtime friend of the mayor and a high-ranking officer in the U.S. Marshals Service before taking over the 2,868-person department in January 1983. Since Palmer assumed his $63,700-a-year post, the beleaguered bureaucracy has been stung by:

*A strongly worded federal court order deploring conditions at the D.C. Jail and ordering a cap on its inmate population.

*Serious morale problems among guards who this year tossed out their union in favor of the tough-minded Teamsters.

*Charges that the department has botched a $41 million education and vocation program financed by the federal government and sponsored by Sen. Arlen Specter (R-Pa.), chairman of the D.C. Appropriations subcommittee.

Palmer defends his administration, saying that he successfully complied with another court order requiring a massive prisoner transfer and that he has improved relations with Fairfax County. He has promoted and decorated many corrections officers, he added, and he has prodded the Specter program into action.

"There are more demands on me than any other director," the tall, silver-haired corrections chief, who is the father of two and lives with his wife in Southeast Washington, said during a recent interview. "I'm in the hot seat day and night."

City Administrator Thomas Downs describes Palmer as a highly visible manager who "has been very successful" at improving security at the District's penal institutions and at handling pressures from Congress, the courts, the D.C. City Council and the news media.

"There are difficulties nationally with corrections systems, whether it is Texas, Maryland, Virginia or Tennessee or almost any other state in the union," Downs said. "We are not any different. We have gone through some massive turmoil in the corrections system in the last several years."

Critics, however, assert that the 56-year-old Palmer, who has no background in corrections, is the wrong man to pull the department out of its longtime problems.

"He seems to have almost no knowledge about running a sizable corrections system," said Alvin Bronstein, director of the National Prison Project of the American Civil Liberties Union. "I say that by way of comparison with the probably more than 30 or 40 state or large jurisdiction directors that I know. His background is not in corrections. One does not see him at the meetings of correctional professionals."

Bronstein cited poor planning and poor maintenance of the city's prisons and jail as the principal defects of the department under Palmer.

Charles S. Lindsay, a retired corrections official who served under Palmer and several other corrections directors, said Palmer's stewardship has led to a souring of morale among the top brass, especially those who were key deputies under Palmer's predecessor, Delbert C. Jackson.

"You don't snatch a person in off the streets and put him in charge of corrections unless he knows the system," said Lindsay, who said he got into a dispute with Palmer over sick leave when he retired.

"When Palmer came in," he added, "we tried to shoulder the guy and take him right along. The guy resisted, and I think the feeling was that we were Delbert Jackson's guys. He made it clear in staff meetings that he was a friend of the mayor: We may challenge him but he is going to win."

There is no question Palmer has endured a lot of heat from his critics during his three years at the helm of the $138 million-a-year agency. The question some observers have asked is: How has he survived?

One reason appears to be the close personal friendship between Palmer and the mayor. The men met in the 1960s when Barry was a civil rights activist and Palmer was in the marshals service. The mayor continues to back Palmer, notwithstanding the embarrassment over the recent Lorton riot.

Palmer has supporters outside the mayor's office as well. They credit him with a knack for handling sensitive issues of politics and protocol. During Palmer's years in the marshals service, he earned high marks from some for his ability to get along with most judges and prisoners, ingratiating himself with the former and controlling the latter in a nonconfrontational way.

In one area of critical concern for the District -- relations with Fairfax County -- Palmer appears to have won friends despite the recent public relations disaster caused by the riot.

"He certainly is more diplomatic and forthcoming than his predecessors," said John F. Herrity, chairman of the county's Board of Supervisors. "That isn't saying much. His predecessors were just totally in touch with their own reality and not the reality here. But he has made an effort to show up at meetings."

Having inherited many of his problems, Palmer escapes some blame for them. Even as he takes flak for failing to rebuild the department, he gets credit for at least trying hard to buff up the agency's image.

"Mr. Palmer is cool," said D.C. City Council member Wilhelmina Rolark (D-Ward 8), chairman of the Judiciary Committee. "He used to be called Mr. Cool when he was in the marshals service. He doesn't get irate or excited when he does things . . . . Barry needs somebody in that job with the personality that Mr. Palmer has."

But even his personality is controversial. Palmer, who has been known to help Barry pick out his suits at men's clothing stores, does not hide his fondness for "nice things" and often talks about his days as a shoeless youth at Grimke Elementary School at 1923 Vermont Avenue NW. The fifth grade classroom of the converted school building is his office.

"Nothing has so improved at the corrections department as that office," grumbled one federal official. "Have you ever seen Xanadu?"

The decor of Palmer's office, while not as elaborate as the storied palace of a Mongolian emperor, was a perfect match for the director's attire during an interview. Palmer's three-piece gray suit, yellow V-neck sweater, yellow handerkerchief, blue shirt and yellow-and-blue tie with gold collar pin blended neatly into an environment of stained-wood wainscotting, white paneled walls and arrangements of pale blue and yellow French-styled furniture, built with inmate labor.

Palmer's smooth, almost ornate manner appears to have divided observers into two camps -- those who say he knows how to smooth ruffled feathers and those who think he is more of a peacock . A highly publicized incident during his 24 years with the U.S. Marshals Service provides an illustration.

Twelve years after becoming the first black to be promoted to a supervisory position in the U.S. Marshals Service, Palmer was a key negotiator in the 1974 takeover of the U.S. District Court cell block by two prisoners.

When the 104-hour siege ended peacefully, Palmer was praised for his cool negotiating hand in what had been a racially tense situation. He was vilified, however, by some federal officials who were in favor of shooting the inmates while they were exposed.

U.S. District Chief Judge George L. Hart Jr. was so disgruntled that he ordered Palmer banished from the federal courthouse, forcing the marshals service to transfer him to another post.

Herbert O. Reid Sr., now the mayor's legal counsel, unsuccessfully sought to have Palmer reinstated, and it was not until early 1978 that Palmer was returned to the senior chief deputy position he held before his run-in with Hart.

When the D.C. corrections department post opened upon the death of Jackson, Palmer approached Elijah B. Rogers and Ivanhoe Donaldson, then top aides to the mayor, to ask for the job. It did not bother Palmer, he said, that two of the previous three directors had died in office.

"I figured that out of all the jobs in the D.C. government, this is one of the most challenging," he said. "To come in here and get along with Jackson's aides was something to overcome."

Shortly after taking office, Palmer found that basic security issues would consume much of his time. While he was largely successful in reducing escapes from Lorton, Palmer was beset by security problems within the penal institutions. These were compounded by a methane gas explosion at Youth Center 1 in December 1984, which forced the transfer of prisoners to other facilities in the prison complex. Many of those facilities were already crowded and under court orders.

During Palmer's tenure, hundreds of prison beds have been added, the department's budget and personnel rolls have risen 40 percent and the inmate population has increased dramatically. The sharp increase in the prison population stems in part from the get-tough incarceration and parole policies advocated by Specter.

As a counterpart to the hard line, Specter in October 1983 won approval in Congress for a $41 million education and vocational initiative to be administered by Palmer's department. The result has been "frustration," in the words of former Watergate prosecutor Richard Ben-Veniste, who was appointed to head a committee overseeing the program.

"He's a law-and-order person. That's his background with the marshals service," Ben-Veniste said. "As far as education and vocational training, this is not an area where he had any practical expertise prior to taking this job . . . . There have been periods of frustration in terms of the implementation of the kind of state-of-the-art programs that we had in mind with the infusion of this kind of money."

Charges of foot-dragging, bureaucratic infighting and waste continue to plague the program, and last week Barry announced the resignation of Margaret Labat, the second program director to leave in two years.

All of these demands, said Palmer, keep him up at night waiting for the inevitable phone calls from his querulous masters and beleaguered subordinates.

Sept. 23 was just such a night. Palmer's man in charge at Lorton Reformatory, James Freeman, assistant director for correctional services, told investigators that he had tried to contact his boss to tell him about the wounding of 13 inmates in a riot.

Palmer had spent much of that day attending a retreat for city officials and another meeting at the convention center. He was informed by subordinates that afternoon that tear gas had been used to try to disperse the inmate demonstrators, he said, but he did not believe that a major disturbance had occurred that would require his presence.

Palmer, invoking confidentiality in what he said was a personnel matter, declined to discuss his whereabouts later that night, when subordinates said they were trying to reach him. But he insisted that he was wearing his pager.

For once, Palmer said, "My Bellboy didn't go off."