通俗来讲,会话(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的更多相关文章

  1. Java操作Sqlite数据库-jdbc连接

    Java操作Sqlite数据库步骤: 1. 导入Sqlite jdbc 本文使用sqlite-jdbc-3.7.2.jar,下载地址 http://pan.baidu.com/s/1kVHAGdD 2 ...

  2. Oracle数据库的连接模式connection Mode、连接connection与会话session

    数据库的连接模式Connection Mode: Dedicated Server Mode(专有模式) 当用户发出请求时,如远程的client端通过监听器连接数据库上,ORACLE的服务器端会启用一 ...

  3. 持久化API(JPA)系列(三)实体Bean的开发技术-建立与数据库的连接

    在EJB 2.x中.EJB有3种类型的Bean.各自是会话Bean(Session Bean).消息驱动Bean(Message-Driven Bean)和实体Bean(Entity Bean). 随 ...

  4. macOS上的ODBC-利用unixODBC连接PostgreSQL与SQLite并进行数据迁移

    安装UnixODBC & PSQLODBC driver for UnixODBC $ brew install psqlodbc Updating Homebrew... ==> In ...

  5. MySQL Error--打开过多文件导致数据库无法连接

    [此文抄自同事的邮件,当作笔记学习] 环境描述Mysql 5.5.21OS centos 5.8zabbix agent 2.4.3 情况描述现象数据库处于运行状态,但是无法创建新的连接,监控报警数据 ...

  6. oracle锁表查询,资源占用,连接会话,低效SQL等性能检查

    查询oracle用户名,机器名,锁表对象 select l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, l.os_user ...

  7. JDBC(1)简单介绍/数据库的连接

    初识JDBC: JDBC是java连接数据库的一个工具,没有这个工具,java将无法和数据库进行连接. JDBC API: JDBC是个“低级”接口,也就是说,他直接用于调用SQL命令. JDBC驱动 ...

  8. oracle连接-会话-进程

    ALTER SYSTEM SET RESOURCE_LIMIT=TRUE;CREATE PROFILE kyc_pro LIMIT IDLE_TIME 2;alter user kyc_acc pro ...

  9. T-SQL 关闭数据库所有连接

    原文引用自: http://www.cnblogs.com/kissazi2/p/3462202.html 下面给出一种删除数据库活动连接的方式.将下面代码段中的"--修改一下"处 ...

  10. php判断数据库是否连接成功的测试例子

    php判断数据库是否连接成功的测试例子 如果出现数据库配置不正确的错误,请看php与mysql的配置教程: win7系统下如何配置php-Apache-mysql环境 http://www.cnblo ...

随机推荐

  1. C# 未能加载文件或程序集“ Newtonsoft.Json” Json格式错误

    原因:版本不一致,所使用的dll和配置文件中的版本不一致.解决: (1)查看所使用的Newtonsoft.Json.dll版本 ,然后把对应的版本修改在配置文件中如下,比如版本为“4.5.0.0” 修 ...

  2. win10下安装PHP_CodeSniffer 检查编码规范

    PHP CodeSniffer是PEAR中的一个用PHP5写的一个PHP的代码风格检测器,它根据预先设定好的PHP编码风格和规则,去检查应用中的代码风格情况是否有违反一组预先设置好的编码标准,内置了Z ...

  3. SSM+Netty项目结合思路

    最近正忙于搬家,面试,整理团队开发计划等工作,所以没有什么时间登陆个人公众号,今天上线看到有粉丝想了解下Netty结合通用SSM框架的案例,由于公众号时间限制,我不能和此粉丝单独沟通,再此写一篇手记分 ...

  4. 汇编语言--微机CPU的指令系统(五)(算术运算指令)

    (3)算术运算指令 算术运算指令是反映CPU计算能力的一组指令,也是编程时经常使用的一组指令.它包括:加.减.乘.除及其相关的辅助指令. 该组指令的操作数可以是8位.16位和32位(80386+).当 ...

  5. file 文件上传,下载,删除

    html: <div class="col-md-4 col-sm-4"> <div class="portlet light bordered&quo ...

  6. CSS实现两列布局,一列固定宽度,一列宽度自适应方法

    不管是左是右,反正就是一边宽度固定,一边宽度自适应. 博客园的很多主题也是这样设计的,我的博客也是右侧固定宽度,左侧自适应屏幕的布局方式. html代码: <div id="wrap& ...

  7. JS无法获取display为none的隐藏元素的宽度和高度的解决方案

    在实际开发中会遇到确实需要获取隐藏元素的宽高,这儿所说的隐藏元素是display为none的元素. 可使用jQuery Actual Plugin插件来完成,其源码如下: ;( function ( ...

  8. POJ1275 Cashier Employment(差分约束)

    Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9078   Accepted: 3515 Description A sup ...

  9. Apache Beam WordCount编程实战及源码解读

    概述:Apache Beam WordCount编程实战及源码解读,并通过intellij IDEA和terminal两种方式调试运行WordCount程序,Apache Beam对大数据的批处理和流 ...

  10. 自己动手写Android插件化框架,让老板对你刮目相看

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由达文西发表于云+社区专栏 最近在工作中接触到了Android插件内的开发,发现自己这种技术还缺乏最基本的了解,以至于在一些基本问题上浪 ...