数据库的连接、会话与SQLite
通俗来讲,会话(Session) 是通信双方从开始通信到通信结束期间的一个上下文(Context)。这个上下文是一段位于服务器端的内存:记录了本次连接的所有相关状态和运行数据.
连接(Connection):连接是从客户端到ORACLE实例的一条物理路径。连接可以在网络上建立,或者在本机通过IPC机制建立。通常会在客户端进程与一个专用服务器或一个调度器之间建立连接。
会话(Session) 是和连接(Connection)是同时建立的,两者是对同一件事情不同层次的描述。简单讲,连接(Connection)是物理上的客户端同服务器的通信链路,会话(Session)是逻辑上的用户同服务器的通信交互。
---------------------
作者:jimsonhappy
来源:CSDN
原文:https://blog.csdn.net/jimsonhappy/article/details/54707694
版权声明:本文为博主原创文章,转载请附上博文链接!

如该流程图所示,SQLite数据库文件打开过程中需要使用到shell.c,main.c,btree.c,pager.c,os.c和os_win.c模块中的相关函数,
最后是由os_win.c模块中的winOpen()函数予以在widows平台上实现对数据库打开,读写等大多数功能。
http://huili.github.io/third/xjklc.html
SQLite层次化数据组织
基本上,具体的数据单元由堆栈中的各模块处理,如图4所示。自下而上,数据变得更加精确、详细。自上而下,数据变得更集中、模糊。具体地说,C API负责域值,VDBE负责处理记录,B-tree负责处理键值和数据,pager负责处理页,操作系统接口负责处理二进制数据和原始数据存储。 每个模块负责维护自身在数据库中对应的数据部分,然后依靠底层提供所需信息的初始数据,并从中提取需要的内容。

http://huili.github.io/B-treeImplementation/hierarchicalorganization.html
** Each open SQLite database is represented by a pointer to an instance of
** the opaque structure named "sqlite3". It is useful to think of an sqlite3
** pointer as an object.
A Database connection is a facility in computer science that allows client software to talk to database server software, whether on the same machine or not. A connection is required to send commands and receive answers, usually in the form of a result set.
Connections are a key concept in data-centric programming. Since some DBMS engines require considerable time to connect connection pooling was invented to improve performance. No command can be performed against a database without an "open and available" connection to it.
Many databases (such as PostgreSQL) only allow one operation to be performed at a time on each connection. If a request for data (a SQL Select statement) is sent to the database and a result set is returned, the connection is open but not available for other operations until the client finishes consuming the result set. Other databases, like SQL Server 2005 (and later), do not impose this limitation. However, databases that provide multiple operations per connection usually incur far more overhead than those that permit only a single operation task at a time.
https://en.wikipedia.org/wiki/Database_connection
The connection is the physical communication channel between SQL Server and the application: the TCP socket, the named pipe, the shared memory region. The session in SQL Server corresponds to the Wikipedia definition of a session: a semi-permanent container of state for an information exchange. In other words the sessions stores settings like cache of your login information, current transaction isolation level, session level SET values etc etc.
Normally there is one session on each connection, but there could be multiple session on a single connection (Multiple Active Result Sets, MARS) and there are sessions that have no connection (SSB activated procedures, system sessions). There are also connections w/o sessions, namely connections used for non-TDS purposes, like database mirroring sys.dm_db_mirroring_connections or Service Broker connections sys.dm_broker_connections.
https://dba.stackexchange.com/questions/13698/what-is-the-difference-between-a-connection-and-a-session
数据库的连接、会话与SQLite的更多相关文章
- Java操作Sqlite数据库-jdbc连接
Java操作Sqlite数据库步骤: 1. 导入Sqlite jdbc 本文使用sqlite-jdbc-3.7.2.jar,下载地址 http://pan.baidu.com/s/1kVHAGdD 2 ...
- Oracle数据库的连接模式connection Mode、连接connection与会话session
数据库的连接模式Connection Mode: Dedicated Server Mode(专有模式) 当用户发出请求时,如远程的client端通过监听器连接数据库上,ORACLE的服务器端会启用一 ...
- 持久化API(JPA)系列(三)实体Bean的开发技术-建立与数据库的连接
在EJB 2.x中.EJB有3种类型的Bean.各自是会话Bean(Session Bean).消息驱动Bean(Message-Driven Bean)和实体Bean(Entity Bean). 随 ...
- macOS上的ODBC-利用unixODBC连接PostgreSQL与SQLite并进行数据迁移
安装UnixODBC & PSQLODBC driver for UnixODBC $ brew install psqlodbc Updating Homebrew... ==> In ...
- MySQL Error--打开过多文件导致数据库无法连接
[此文抄自同事的邮件,当作笔记学习] 环境描述Mysql 5.5.21OS centos 5.8zabbix agent 2.4.3 情况描述现象数据库处于运行状态,但是无法创建新的连接,监控报警数据 ...
- oracle锁表查询,资源占用,连接会话,低效SQL等性能检查
查询oracle用户名,机器名,锁表对象 select l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, l.os_user ...
- JDBC(1)简单介绍/数据库的连接
初识JDBC: JDBC是java连接数据库的一个工具,没有这个工具,java将无法和数据库进行连接. JDBC API: JDBC是个“低级”接口,也就是说,他直接用于调用SQL命令. JDBC驱动 ...
- oracle连接-会话-进程
ALTER SYSTEM SET RESOURCE_LIMIT=TRUE;CREATE PROFILE kyc_pro LIMIT IDLE_TIME 2;alter user kyc_acc pro ...
- T-SQL 关闭数据库所有连接
原文引用自: http://www.cnblogs.com/kissazi2/p/3462202.html 下面给出一种删除数据库活动连接的方式.将下面代码段中的"--修改一下"处 ...
- php判断数据库是否连接成功的测试例子
php判断数据库是否连接成功的测试例子 如果出现数据库配置不正确的错误,请看php与mysql的配置教程: win7系统下如何配置php-Apache-mysql环境 http://www.cnblo ...
随机推荐
- [android] 请求码和结果码的作用
当一个界面中要要开启多个带有返回值的activity时,这个时候,就需要用到请求码和结果码了 调用startActivityForResult(intent,requestCode)方法,开启acti ...
- Python 内置函数笔记
其中有几个方法没怎么用过, 所以没整理到 Python内置函数 abs(a) 返回a的绝对值.该参数可以是整数或浮点数.如果参数是一个复数,则返回其大小 all(a) 如果元组.列表里面的所有元素都非 ...
- virtualbox中 清理磁盘
1. 碎片整理 windows: 下载 sdelete 工具 执行命令: sdelete –z c:\ Linux: 执行如下命令: sudo dd if=/dev/zero of=/EMPTY bs ...
- laravel 数据库操作(表、字段)
1)创建表(make:migration create),例如创建 articles php artisan make:migration create_articles_table --create ...
- Html5页面内使用JSON动画的实现
有一天我们的UI设计师找到我说,要把页面中我自己用程序写的动画,换成他们给的json动画,原因是有的动画很复杂,自己写起来达不到他们的预期效果(写到这里我突然想到一个问题,这么复杂的动画为什么不使用g ...
- 判断浏览器的名称,区分360的ie和谷歌内核
function getBrowserInfo() { var ua = navigator.userAgent.toLocaleLowerCase(); var browserType = null ...
- 使用Vue-Router 2实现路由功能
转自:http://blog.csdn.net/sinat_17775997/article/details/54710420 注意:vue-router 2只适用于Vue2.x版本,下面我们是基于v ...
- cf1136E. Nastya Hasn't Written a Legend(二分 线段树)
题意 题目链接 Sol yy出了一个暴躁线段树的做法. 因为题目保证了 \(a_i + k_i <= a_{i+1}\) 那么我们每次修改时只需要考虑取max就行了. 显然从一个位置开始能影响到 ...
- Foundry feats. MultiverseStudio
https://www.foundry.com/news-awards/foundry-jcube-announcement 经过这么多年的过程,本周本产品终于发布了PR,这次是由Foundry独家代 ...
- Python __init__.py文件的作用
我们经常在python的模块目录中会看到 "__init__.py" 这个文件,那么它到底有什么作用呢? 1. 模块包(module package)标识 如果你是使用pytho ...