当前位置:网站首页>Gbase8s database makes the current connection a dormant connection
Gbase8s database makes the current connection a dormant connection
2022-07-22 18:11:00 【Like to eat radish ice cold】
stay SET CONNECTION connection DORMANT In the sentence ,connection Must represent the current connection . with
DORMANT Option SET CONNECTION Statement to make the specified current connection a dormant connection .
for example , The following SET CONNECTION Statement make connection con1 Sleep :
SET CONNECTION ‘con1’ DORMANT;
If you specify a connection that is already dormant , With DORMANT Option SET CONNECTION Statement generation error
By mistake . for example , If connected con1 It is current. , And connect con2 It's dormant , Then SET CONNECTION sentence
Return error message :
SET CONNECTION ‘con2’ DORMANT;
The following SET CONNECTION Statement successfully executed :
SET CONNECTION ‘con1’ DORMANT;
Dormant connections in a single threaded environment
In single thread GBase 8s ESQL/C application ( Not using threads ) in ,DORMANT Option to make the current connection sleep
Of . Use this option to make single threaded GBase 8s ESQL/C Application and thread safe GBase 8s ESQL/C Application up and
Rong . However , When the program is executed , A single threaded environment can have only one active connection .
Dormant connections in a thread safe environment
In thread safe GBase 8s ESQL/C Application ,DORMANT Option to make active connections dormant . Now the other line
Process can be sent without DORMANT Option SET CONNECTION Statement to use the connection . In a GBase 8s
ESQL/C Application , A thread safe environment can have many threads ( The concurrent part of the work that performs a particular task ), And every thread
Can there be an active connection .
Active connections are associated with specific threads . Two threads cannot share the same active connection . Once the thread makes the active connection
For dormant , Other threads can use that connection . Still establish a dormant connection , But the currently dormant connection is not connected to any thread
relation . for example , If it is named thread_1 In the thread named con1 The connection of is active , It is called thread_2
Thread of cannot make connection con1 Become its active connection , until thread_1 Connected con1 Become dormant for
stop .
The following are from thread safe GBase 8s ESQL/C Code snippets of the program are shown in thread safe applications , Specific threads
How to make the connection active , Perform work on the table through this connection , Then make the connection dormant , So that other lines
The program can use this connection :
thread_2()
{ /* send con2 Become an active connection */
EXEC SQL connect to ‘db2’ as ‘con2’;
/Do insert on table t2 in db2/
EXEC SQL insert into table t2 values(10);
/* Make other threads available con2 */
EXEC SQL set connection ‘con2’ dormant;
}
If you use CONNECT . . . WITH CONCURRENT TRANSACTION Statement initializes the connection to the database environment
Pick up , Then any thread that then connects to that database environment can use the ongoing transaction . Besides , If an open cursor is associated with
Such connections are related , When the link becomes dormant , The cursor remains open .
In thread safe GBase 8s ESQL/C Threads within an application can use the same thread by making the associated connection current
mark , Even if only one thread can use the connection at any given time .
边栏推荐
- verilog之for循环(1)
- UART communication experiment (query mode)
- 力扣练习——24 去除重复字母
- GBase8s数据库标识连接
- Physical layer of network
- Branch and loop statements
- 【3D目标检测】稀疏卷积
- 24、 TF coordinate transformation (IV): multi coordinate transformation and coordinate system relationship view
- 融合注意力机制和BSRU的工业互联网安全态势预测方法
- 1.4.1 好多好多道符(cin/cout解绑,O3优化)
猜你喜欢
Concurrent model values actor and CSP
Logistic regression (formula derivation +numpy Implementation)
【OpenCV入门实战】利用电脑前置摄像头进行人脸检测
Linear regression (formula derivation +numpy Implementation)
Data link layer of network (PPP Protocol)
Use of bullets in object pool mode in aircraft war
毕业985,工作996,也躲不开中年危机
Super practical transformation strategy: 2022 central state-owned enterprise cloud native landing practical guide was officially released
异常的理解学习
Rk3399 platform development series explanation (alsa subsystem) 4.37, alsa driven framework
随机推荐
Vscode failed to install tools
【论文汇总】2D目标检测文章汇总,持续更新
JS String charAt substring() substr slice toUpperCase toLowerCase indexOf
力扣练习——26 分割数组为连续子序列
pushgateway安装及Prometheus配置
力扣练习——32 划分为k个相等的子集
Understanding and learning of arrays class
Rk3399 platform development series explanation (input subsystem) 4.52. Implementation principle of input subsystem
Niuke brush SQL
超实用转型攻略:《2022央国企云原生落地实用指南》正式发布
异常的理解学习
Learn TB writing method with SPI simulation file
[case sharing] configure the routing penetration function of IS-IS
Bigder: common business terms in 36/100 report testing
地图找房的实例
GBase8s数据库SET Database Object Mode 语句
Anaconda 环境迁移
Arrays类的理解学习
飞机大战中对象池模式子弹使用
JS to determine whether the linked image exists