Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a066f9e3
Kaydet (Commit)
a066f9e3
authored
Tem 12, 2013
tarafından
Andrzej J.R. Hunt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Implement transaction isolation in firebird-sdbc.
Change-Id: Id18c26cbd62b2cf9573ffafcd3da0041c2d8e9c5
üst
25772a93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
FConnection.cxx
connectivity/source/drivers/firebird/FConnection.cxx
+27
-8
FConnection.hxx
connectivity/source/drivers/firebird/FConnection.hxx
+3
-0
No files found.
connectivity/source/drivers/firebird/FConnection.cxx
Dosyayı görüntüle @
a066f9e3
...
@@ -96,6 +96,7 @@ OConnection::OConnection(FirebirdDriver* _pDriver)
...
@@ -96,6 +96,7 @@ OConnection::OConnection(FirebirdDriver* _pDriver)
m_bUseOldDateFormat
(
sal_False
),
m_bUseOldDateFormat
(
sal_False
),
m_bAutoCommit
(
sal_True
),
m_bAutoCommit
(
sal_True
),
m_bReadOnly
(
sal_False
),
m_bReadOnly
(
sal_False
),
m_aTransactionIsolation
(
TransactionIsolation
::
REPEATABLE_READ
),
m_DBHandler
(
0
),
m_DBHandler
(
0
),
m_transactionHandle
(
0
)
m_transactionHandle
(
0
)
{
{
...
@@ -383,11 +384,31 @@ void OConnection::setupTransaction()
...
@@ -383,11 +384,31 @@ void OConnection::setupTransaction()
isc_rollback_transaction
(
status_vector
,
&
m_transactionHandle
);
isc_rollback_transaction
(
status_vector
,
&
m_transactionHandle
);
}
}
char
aTransactionIsolation
=
0
;
switch
(
m_aTransactionIsolation
)
{
// TODO: confirm that these are correct.
case
(
TransactionIsolation
:
:
READ_UNCOMMITTED
)
:
aTransactionIsolation
=
isc_tpb_concurrency
;
break
;
case
(
TransactionIsolation
:
:
READ_COMMITTED
)
:
aTransactionIsolation
=
isc_tpb_read_committed
;
break
;
case
(
TransactionIsolation
:
:
REPEATABLE_READ
)
:
aTransactionIsolation
=
isc_tpb_consistency
;
break
;
case
(
TransactionIsolation
:
:
SERIALIZABLE
)
:
aTransactionIsolation
=
isc_tpb_consistency
;
break
;
default
:
assert
(
false
);
// We must have a valid TransactionIsolation.
}
static
char
isc_tpb
[]
=
{
static
char
isc_tpb
[]
=
{
isc_tpb_version3
,
isc_tpb_version3
,
(
char
)
(
m_bAutoCommit
?
isc_tpb_autocommit
:
0
),
(
char
)
(
m_bAutoCommit
?
isc_tpb_autocommit
:
0
),
(
char
)
(
!
m_bReadOnly
?
isc_tpb_write
:
isc_tpb_read
),
(
char
)
(
!
m_bReadOnly
?
isc_tpb_write
:
isc_tpb_read
),
isc_tpb_read_committed
,
// TODO: set isolation level here
aTransactionIsolation
,
isc_tpb_wait
isc_tpb_wait
};
};
...
@@ -486,24 +507,22 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ
...
@@ -486,24 +507,22 @@ void SAL_CALL OConnection::setCatalog( const ::rtl::OUString& catalog ) throw(SQ
// return your current catalog
// return your current catalog
return
::
rtl
::
OUString
();
return
::
rtl
::
OUString
();
}
}
// --------------------------------------------------------------------------------
void
SAL_CALL
OConnection
::
setTransactionIsolation
(
sal_Int32
level
)
throw
(
SQLException
,
RuntimeException
)
void
SAL_CALL
OConnection
::
setTransactionIsolation
(
sal_Int32
level
)
throw
(
SQLException
,
RuntimeException
)
{
{
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
checkDisposed
(
OConnection_BASE
::
rBHelper
.
bDisposed
);
checkDisposed
(
OConnection_BASE
::
rBHelper
.
bDisposed
);
// set your isolation level
m_aTransactionIsolation
=
level
;
// please have a look at @see com.sun.star.sdbc.TransactionIsolation
setupTransaction
();
}
}
// --------------------------------------------------------------------------------
sal_Int32
SAL_CALL
OConnection
::
getTransactionIsolation
(
)
throw
(
SQLException
,
RuntimeException
)
sal_Int32
SAL_CALL
OConnection
::
getTransactionIsolation
(
)
throw
(
SQLException
,
RuntimeException
)
{
{
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
::
osl
::
MutexGuard
aGuard
(
m_aMutex
);
checkDisposed
(
OConnection_BASE
::
rBHelper
.
bDisposed
);
checkDisposed
(
OConnection_BASE
::
rBHelper
.
bDisposed
);
return
m_aTransactionIsolation
;
// please have a look at @see com.sun.star.sdbc.TransactionIsolation
return
TransactionIsolation
::
NONE
;
}
}
// --------------------------------------------------------------------------------
// --------------------------------------------------------------------------------
Reference
<
::
com
::
sun
::
star
::
container
::
XNameAccess
>
SAL_CALL
OConnection
::
getTypeMap
(
)
throw
(
SQLException
,
RuntimeException
)
Reference
<
::
com
::
sun
::
star
::
container
::
XNameAccess
>
SAL_CALL
OConnection
::
getTypeMap
(
)
throw
(
SQLException
,
RuntimeException
)
...
...
connectivity/source/drivers/firebird/FConnection.hxx
Dosyayı görüntüle @
a066f9e3
...
@@ -110,6 +110,9 @@ namespace connectivity
...
@@ -110,6 +110,9 @@ namespace connectivity
sal_Bool
m_bUseOldDateFormat
;
sal_Bool
m_bUseOldDateFormat
;
sal_Bool
m_bAutoCommit
;
sal_Bool
m_bAutoCommit
;
sal_Bool
m_bReadOnly
;
sal_Bool
m_bReadOnly
;
sal_Int32
m_aTransactionIsolation
;
isc_db_handle
m_DBHandler
;
isc_db_handle
m_DBHandler
;
isc_tr_handle
m_transactionHandle
;
isc_tr_handle
m_transactionHandle
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment