数据库的连接、会话与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 ...
随机推荐
- C#中saveFileDialog(另存为)保存图片文件
弹出另存为提示框保存图片文件: //用户自由选择指定路径保存文件 SaveFileDialog savedialog = new SaveFileDialog(); ...
- SpringBoot中异步请求和异步调用(看这一篇就够了)
原创不易,如需转载,请注明出处https://www.cnblogs.com/baixianlong/p/10661591.html,否则将追究法律责任!!! 一.SpringBoot中异步请求的使用 ...
- python面向对象学习(七)单例
目录 1. 单例设计模式 单例设计模式的应用场景 2. __new__ 方法 3. Python 中的单例 只执行一次初始化工作 1. 单例设计模式 设计模式 设计模式 是 前人工作的总结和提炼,通常 ...
- mybatis缓存机制
目录 mybatis缓存机制 Executor和缓存 一级缓存 小结 二级缓存 小结 mybatis缓存机制 mybatis支持一.二级缓存来提高查询效率,能够正确的使用缓存的前提是熟悉mybatis ...
- crontab清理日志
1.日志介绍 2.日志清理 (以下达到清理效果) du -sh * //查看日志大小 * 1 * * * cat /dev/null > /var/log/message 解释/dev/nul ...
- C# SqlBulkCopy类批量导入 测试
一.功能说明 1.可以选择,只导入部分列,或者导入全部列. 2.导入速度的确比一般sql要快. 3.不用写sql语句 ----------------------------------------- ...
- es6 语法 (map、set和array 的对比)
//数据结构对比 增查改删 { //map和array对比 let map = new Map(); let array = []; //增 map.set('t',1); array.push({t ...
- CSS3效果:animate实现点点点loading动画效果(一)
实现如图所示的点点点loading效果: 一:CSS3 animation实现代码 html代码: 提交订单中<span class="ani_dot">...< ...
- tomcat闪退解决
异常原因:拷贝了一个tomcat到新机器上,运行startup闪退 解决方法: 1.检查发现当前系统没有安装配置jdk,安装配置后运行仍然闪退 2.在tomcat的启动脚本和关闭脚本中指定JDK和to ...
- python地理处理包——geopy使用之地理编码与反地理编码
由于专业需要,经常接触一些地理处理的工具包,文档都是英文的,自己看的同时将其翻译一下,一方面自己学习的同时有个记录,要是能同时给一起的学习的童鞋们一些帮助,想想也是极好的.以下的文档内容主要翻译自官方 ...