Hi! I’m using “interactiveTransactions”. In follo...
# orm-help
m
Hi! I’m using “interactiveTransactions”. In following case, both txid1 and txid2 have same value(It means same transaction).
Copy code
await prisma.$transaction(async (prisma) => {
    const txid1 = await prisma.$queryRawUnsafe('SELECT txid_current()')
    console.log('txid1', txid1)

    const txid2 = await prisma.$queryRawUnsafe('SELECT txid_current()')
    console.log('txid2', txid2)
  })
But the following case, both txid1 and txid2 have different value(It means different transaction).
Copy code
await prisma.$transaction(async (prisma) => {
    const txid1 = await prisma.$queryRawUnsafe('SELECT txid_current()')
    console.log('txid1', txid1)

    const txid2 = await prisma.$queryRawUnsafe('SELECT txid_current()').then() // Code changes
    console.log('txid2', txid2)
  })
I don’t know why the behavior changes. Is this a specification? Is there any way to use “then()” in same transaction? Thank you.
n
Hey Masayuki 👋 thanks for raising this! I’ve brought this up with our Engineering team and will get back to you soon 🙂
m
Hey Nikolas! thanks for you and engineering team help!
n
Ok, so it seems like this most likely indeed is a bug. Would you mind reporting it in a new GitHub issue if you have a few minutes? 🙂
m
thanks for confirm. I have created a new issue. https://github.com/prisma/prisma/issues/10615
🙏 1