santi
santi
Explore posts from servers
PPrisma
Created by santi on 7/18/2024 in #help-and-questions
unexpected message from server
Hi all, we see this error pretty randomly
error in connector: error querying the database: unexpected message from server
I try to replicate with the same query, but the error persists. Is this the kind of error wherein it makes sense to implement some kind of retry logic?
3 replies
PPrisma
Created by santi on 5/9/2024 in #help-and-questions
Which is more efficient: Promise.all([findUnique() * 3]) or prisma.$transaction([findUnique() * 3])?
With prisma, is it more efficient to do
await Promise.all([
prisma.product.findMany()
prisma.order.findMany()
prisma.catalog.findFirst()
])
await Promise.all([
prisma.product.findMany()
prisma.order.findMany()
prisma.catalog.findFirst()
])
OR
await prisma.$transaction([
prisma.product.findMany()
prisma.order.findMany()
prisma.catalog.findFirst()
])
await prisma.$transaction([
prisma.product.findMany()
prisma.order.findMany()
prisma.catalog.findFirst()
])
Maybe transaction is slower because of transactional integrity? Or is there another command / alternative to $transaction that allows me to make just one trip to the database, rather than many? Ideally this is about optimizing efficiency/time/being better than Promise.all, and not about transactional integrity
1 replies