Hi friends, is it possible to use an interactive t...
# orm-help
s
Hi friends, is it possible to use an interactive transaction across modules? We have a NextJS that imports a single prisma client through our app, but found that when we call another helper (that also uses calls prisma) the call fails. Heres a rough example:
Copy code
import { prisma } from "../prisma";


await prisma.$transaction(async (prisma) => {
    
    const booking = await prisma.bookingGroup.create(..)
    EmailService.sendEmail(booking) //If this function also has a prisma call, the transaction fails

});
I'm unsure if theres a best practice we should be following here (we're looking to keep our code concise but this seems to be a limitation of abstracting out logic if it involves the database)