Skip to content

Nested transactions, prisma 8 #30205

Description

@Xmajk

What problem are you trying to solve?

Hi, i want to write my app backend with prisma 8, i would rather to do in newer version, but if i was trying to do nested transaction i found i cant do like in prisma 7. May I ask you if this is not implemented to do, or if is and i didnt found it please send me link.

Proposed solution

        let tmp = await db.transaction(async (tx) => {
            const newTst =  tx.orm.public.Tst.create({
                name: new Date().toISOString()
            })

            try{
                tx.transaction((async (nestedTx) => {
                    //... work with nested transaction
                })
            }catch(e){
                console.log(e)
            }

        })

Alternatives considered

No response

Scope and impact

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions