Updated Peristance layer to use the new error_hanler based on EWF error library.

Remove once use from DATABASE_ERROR_HANDLER.
Initial support transaction handling.
This commit is contained in:
jvelilla
2014-10-17 08:53:02 -03:00
parent 3c73202a0d
commit 5cb26f0b24
18 changed files with 254 additions and 674 deletions

View File

@@ -23,6 +23,7 @@ feature -- Initialization
local
l_retried: BOOLEAN
do
create database_error_handler.make
create db_application.login (username, password)
if not l_retried then
@@ -38,6 +39,7 @@ feature -- Initialization
create db_control.make
end
rescue
create database_error_handler.make
exception_as_error ((create {EXCEPTION_MANAGER}).last_exception)
l_retried := True
retry
@@ -49,6 +51,7 @@ feature -- Initialization
local
l_retried: BOOLEAN
do
create database_error_handler.make
create db_application.login (username, password)
if not l_retried then
@@ -64,6 +67,7 @@ feature -- Initialization
create db_control.make
end
rescue
create database_error_handler.make
exception_as_error ((create {EXCEPTION_MANAGER}).last_exception)
l_retried := True
retry
@@ -76,6 +80,7 @@ feature -- Initialization
-- `database_name' to `a_database_name'
-- `connection' to `a_connection'
do
create database_error_handler.make
create db_application.login (a_username, a_password)
db_application.set_hostname (a_hostname)
db_application.set_data_source (a_database_name)
@@ -97,6 +102,8 @@ feature -- Initialization
l_user: STRING
l_password: STRING
do
create database_error_handler.make
l_string := a_string.split (';')
l_server := l_string.at (2).split ('=').at (2)
l_port := l_string.at (3).split ('=').at (2)
@@ -111,12 +118,12 @@ feature -- Initialization
db_application.set_base
create db_control.make
keep_connection := is_keep_connection
end
login_with_schema (a_schema: STRING; a_username: STRING; a_password: STRING)
-- Login with `a_connection_string'and immediately connect to database.
do
create database_error_handler.make
create db_application
db_application.set_application (a_schema)
db_application.login_and_connect (a_username, a_password)