问题描述
我们有我们在我们的.NET的MVC Web应用程序使用MySQL数据库。我们实现连接池,因为它有一些很大的性能优势。
We have a MySQL database which we use in our .NET MVC Web App. We implement connection pooling as it has some great performance benefits.
我们也有一些存储的关键程序做了一些相当沉重的处理。
We also have some fairly heavy processing done in a few key stored procedures.
他们创建几个临时表并保持有效的连接的生命用户变量。然而,随着池启用这些物体没有得到复位/丧生。
They create several temporary tables and user variables which remain valid for the life of a connection. However with pooling enabled these objects don't get reset / killed.
我是不是应该重新初始化用户变量和滴/在这种情况下重新创建临时表?
Should I just be re-initializing user variables and dropping/recreating temporary tables in this scenario?
的连接保证不会在同一时间被访问,所以我不应该当两个SP的正在执行的任何并发问题/填充临时表等。
The connections are guaranteed not to be accessed at the same time so I shouldn't have any concurrency issues when two SP's are executing/populating temporary tables etc.
推荐答案
因此,答案是重新创建每次之前只是删除临时表。有没有并发问题,因为它永远只可以一次运行一个命令。
So the answer was simply drop the temp table before recreating each time. There are no concurrency issues as it only ever can run one command at a time.
这篇关于.NET连接池的MySQL临时表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!