简体   繁体   English

SAP HANA:启用连接池时不会自动删除临时表

[英]SAP HANA: Temporary table not dropped automatically when connection pooling is enabled

I am using ADO.NET to connect SAP HANA database.我正在使用 ADO.NET 连接 SAP HANA 数据库。 I enable connection pooling in connection string like this: Server=hana-db:30015;Pooling=true;Max Pool Size=50;Min Pool Size=5;UserID=JSmith;Password=secret .我在连接字符串中启用连接池,如下所示: Server=hana-db:30015;Pooling=true;Max Pool Size=50;Min Pool Size=5;UserID=JSmith;Password=secret But my problem is that, when I first connect to database and create a temporary table called #tbl, then disconnect without dropping #tbl.但我的问题是,当我第一次连接到数据库并创建一个名为#tbl 的临时表时,然后断开连接而不删除#tbl。 And when I reconnect to database, table #tbl still exists.当我重新连接到数据库时,表 #tbl 仍然存在。
That doesn't happen when I set Pooling=false.当我设置 Pooling=false 时不会发生这种情况。 So when Pooling=true, do I need manual drop temporary tables?那么当Pooling=true时,是否需要手动drop临时表呢? Cause in MSSQL or Postgresql, temp tables dropped automatically when connection closed.在 MSSQL 或 Postgresql 中,临时表在连接关闭时自动删除。

I believe in MSSQL it only drops the temp table on connection close when it's inside of a Stored Procedure.我相信在 MSSQL 中,当它位于存储过程中时,它只会在连接关闭时删除临时表。 If your query is outside of a SP you will need to drop the temp tables yourself.如果您的查询在 SP 之外,您将需要自己删除临时表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM