通俗来讲,会话(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. mybatis_02简单操作数据库

    模糊查询用户信息 <!-- [${}]:表示拼接SQL字符串 [${value}]:表示要拼接的是简单类型参数. 注意: 1.如果参数为简单类型时,${}里面的参数名称必须为value 2.${ ...

  2. 【Spring】22、Spring缓存注解@Cache使用

    缓存注解有以下三个: @Cacheable      @CacheEvict     @CachePut @Cacheable(value=”accountCache”),这个注释的意思是,当调用这个 ...

  3. Bean实例化的三种方式

    1. 构造器实例化 spring容器通过bean对应的默认的构造函数来实例化bean. 2. 静态工厂方式实例化 首先创建一个静态工厂类,在类中定义一个静态方法创建实例. 静态工厂类及静态方法: pu ...

  4. 基于redis的分布式锁(不适合用于生产环境)

    基于redis的分布式锁 1 介绍 这篇博文讲介绍如何一步步构建一个基于Redis的分布式锁.会从最原始的版本开始,然后根据问题进行调整,最后完成一个较为合理的分布式锁. 本篇文章会将分布式锁的实现分 ...

  5. idea中查看方法参数;查看类、方法、属性注释

    Ctrl+P:查看方法参数Ctrl+Q:查看类.方法.属性注释

  6. 一个优秀的SEOer必须掌握的三大标配技术

    首先,认识网页代码是基础 这里所讲的网页代码是指HTML代码,并不是指复杂的PHP模板技术.一般的培训机构总是提倡学SEO不用学网页代码,只要会购买域名空间搭建网站就行,因为现在的网站模板太丰富了,对 ...

  7. 前端入门4-CSS属性样式表

    本篇文章已授权微信公众号 dasu_Android(大苏)独家发布 声明 本系列文章内容全部梳理自以下四个来源: <HTML5权威指南> <JavaScript权威指南> MD ...

  8. JS之表单提交时编码类型enctype详解

    简介 form的enctype属性为编码方式,常用有两种:application/x-www-form-urlencoded和multipart/form-data,默认为application/x- ...

  9. CentOS 安装 jdk

    1.首下载CentOS对应的jdk压缩包. 2.通过secureCRT工具远程连接目标服务器. 3.通过rz命令上传jdk压缩包到linux服务器. 4.解压缩上传的jdk压缩包 tar -zxvf ...

  10. SQL注入与防范

    首先给大家看个例子: 1)小编首先在数据库中建立了一张测试表logintable,表内有一条测试信息: 然后写了个测试程序: package com.java.SqlInject; import ja ...