JAMES PATRICK Donleavy was 29 years old when he wrote The Ginger Man. Now he is 51, and he has been writing the same novel for a quarter of a century.

To his credit, it is astonishing that after eight books the formula still works at all, because Donleavy does not write novels so much as Oedipal fairy tales: semirealistic fables in which the same patterns are obsessively reenacted. Invariably, a young man finds himself trapped in a society dominated by hostile father-figures and devoid of the uncritical comfort afforded by mothers. (Mothers are inevitably dead in Donleavy's books.) Every time the young man attempts to assert his ego in this world, he fails or is beaten, and flees to succour - either to the manic medium of alcohol or the overt mother-surrogates who provide sex and self-esteem, for a while.

But his fixation on this fantasy content rarely kept Donleavy from turning it into richly comic material. After all, the same psychological nexus had contained some of the finest humorists in English, including the early James Joyce, Evelyn Waugh, Joyce Cary and Kingsley Amis. Donleavy brought to the mix his own paradoxical blend of violent arrogance and sentimentality, fastidious elegance and explicit vulgarity, bound together with a brokenly rhythmical prose style which could be marvelously melancholy and comic by turns.

That admixture made The Ginger Man a powerful book in 1955 (and in 1965, when the first unexpurgated edition became available in America) - not only because those elements were fresh then, but because Donleavy had a perspective on his characters which he has begun to lose in recent years. He seemed to recognize that the character traits which he knew and portrayed best were an apotheosis of the infantile, that the soul of Sebastian Dangerfield is essentially very childish, stuck at the point where the overweening need for immediate gratification of every desire runs up against a world which is unwilling to provide it.

That collision makes up the plot. Either Sebastian throws a tantrum (the bar fights, the "fist in the gob") or he runs to mother (the various women, often older, with their "enfolding caresses" - a favorite Donleavy phrase). And yet, despite his behavior, Donleavy makes us give our sympathy to this character whom we would not want to know - or drink with or have our sister marry - in real life. Judged by workaday ethical standards, Sebastian is a pretty contemptible specimen - as squeamish critics of the book rather archly pointed out - because he doesn't do anything, but instead merely expects the world to reward him for his delicate soul, which is what mothers do. But that, of course, is missing the point. Judged by fairy-tale standards, Sebastian appeals to the buried infant in each of us, making the reader react so sympathetically that through the pain, the very obnoxiousness of his actions, we reluctantly admire this embarrassing child-man and acknowledge that he has a certain panic dignity.

After The Ginger Man, however, Donleavy seems to have gradually lost control, to have fallen uncritically in love with the infantile monomania of his characters, until he began to take the reader's sympathy for granted. After all. Sebastian Dangerfield is funny in direct proportion to the fact that his pain is very real. Powerless to alter his own arrogance, but sentimentally guilty about his actions, he goes on anyway, willing to pay the price. But in the next book, A Singular Man, Donleavy split those elements into two separate characters - the sentiment into the brooding George Smith, the frenzy into the ubiquitous satyr-figure Bonniface - and in doing so forfeited the antithetical complexity which was his greatest strength. Even so, he managed to make that configuration work through two superbly funny novels, The Beastly Beatitudes of Baithazar B (1968) and The Onion Eaters (1971).

By A Fairy Tale of New York (1973), though, the formula had become both mannered and somewhat annoying. Donleavy recombined the two elements into Cornelius Christian, whom he hoped to use as an Old World bench mark by which to measure the violence and barbarity of American culture. Unhappily, it didn't work, because the reader's wholesale sympathy for Christian's sentimental side is merely assumed. He remains an empty emblem, and the plot is little more than a series of outrages when Christian does not get instant submission to his own arrogance.

In Darcy Dancer, we are once again being asked to give our sympathy unearned to a character who contains all the most cloying elements of Donleavy's self-indulgent side, one who is capable of this representative exchange:

"I am an imperialist member of the squirearchy and imperialists, madam, dress this way."

"O we are grand aren't we."

"Yes I am."

Donleavy's most devoted readers will still find considerable vestigial satisfaction in this tale of a teenaged Irish aristocrat who strives to recover his rightful inheritance from his sadistic rake of a father and from a society which only grudgingly recognizes Darcy's soi-disant nobility of spirit. Of course, the narrative is interlarded with the expected ribald sequences - including Darcy's sexual initiation by his father's housekeeper - and by the return of the Bonniface character who provides most of the humor in lewd pratfalls and drunken catastrophes.

But at bottom it seems an exhausted book, too patently more the same. Darcy's fight with his father, his fight from the ancestral castle, his ordeal on the road are ultimately tiresome and as embarrassing as Darcy's reflection that, "Dear me, why should I care about another cursed thing. Except to preserve my own sweet life. Towards the destiny which the better of my past best ancesors ordain."

It would be comforting to think that this is satire, that Donleavy is at last parodying the supercilious egocentrism in which he seems trapped. But that is not the case. Donleavy expects us to understand and underwrite Darcy's attitude just as, last year, he expected us to understand and sympathize with his retrospective apoligia for leaving America.

Writing in the December 1976 Atlantic, Donleavy tells of how he returned in his mid-20s from Trinity College, Dublin, to his native New York - which he found hostile, philistine and mainly just too indifferent to J. P. Donleavy. He wrote to a friend still in Ireland that America was "all vulgarity obscenity and money. So tragic that I just sit and sit full of pain . . . All the wonderful things in me are locked up." Only a few months later he has decided that in the United States "a lyric voice could not be heard unless heralded coast to coast by a throbbing promotional media campaign. And that that country, be it the home of my birth and where I grew up, was not about to give it to me. And if I stayed, they would, without even trying, or knowing, kill me."

If this is a little melodramatic, it is also revealing. Like his own heroes, Donleavy expected to be given recognition by the mother country. And when he didn't get it, he ran away. But unlike his own characters, Donleavy was able to turn his delicate soul and lyric voice into admirable comedy, which he stretched increasingly thin over eight books.

We can hope that now Donleavy has finally written out the last of his Ginger-books, finally exorcised the psychological possession which was the source of both his genius and his predictability. If he has done so, the next novel will be something to see.