Skip to content
Discussion options

You must be logged in to vote

Hi guys, how u doing?

I have the same cenarious here. I'm devolping a create user service and when this service calls my repository to create the user, i open a transaction. Inside this transaction i need to call my add-profile service to create the user with the respective profiles.

The problem occurs because my repository where i create the user is using the transaction, but when i call my service to create profile it is using the prisma client.

I can't create nasted transactions, but i can overwrite other classes "this" context to use the same transaction as PrismaClient. This is the only way that i found to do what i want. The otherway was duplicating code to use nasted queries how is…

Replies: 6 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@felinto-dev
Comment options

Comment options

You must be logged in to vote
6 replies
@janpio
Comment options

@felinto-dev
Comment options

@janpio
Comment options

@vladi-stevanovic
Comment options

@boredland
Comment options

Comment options

You must be logged in to vote
2 replies
@pantharshit00
Comment options

@avin-kavish
Comment options

Answer selected by pantharshit00
Comment options

You must be logged in to vote
1 reply
@captyoungkyu
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment