You've already forked linux-packaging-mono
acceptance-tests
data
docs
external
ikvm-native
libgc
llvm
m4
man
mcs
build
class
Accessibility
Commons.Xml.Relaxng
Cscompmgd
CustomMarshalers
Facades
I18N
IBM.Data.DB2
ICSharpCode.SharpZipLib
Microsoft.Build
Microsoft.Build.Engine
Microsoft.Build.Framework
Microsoft.Build.Tasks
Microsoft.Build.Utilities
Microsoft.CSharp
Microsoft.NuGet.Build.Tasks
Microsoft.VisualC
Microsoft.Web.Infrastructure
MicrosoftAjaxLibrary
Mono.Btls.Interface
Mono.C5
Mono.CSharp
Mono.Cairo
Mono.Cecil
Mono.Cecil.Mdb
Mono.CodeContracts
Mono.CompilerServices.SymbolWriter
Mono.Data.Sqlite
Mono.Data.Tds
Mono.Debugger.Soft
Mono.Http
Mono.Management
Mono.Messaging
Mono.Messaging.RabbitMQ
Mono.Options
Mono.Parallel
Mono.Posix
Mono.Profiler.Log
Mono.Runtime.Tests
Mono.Security
Mono.Security.Win32
Mono.Simd
Mono.Tasklets
Mono.WebBrowser
Mono.XBuild.Tasks
Novell.Directory.Ldap
PEAPI
RabbitMQ.Client
SMDiagnostics
System
System.ComponentModel.Composition.4.5
System.ComponentModel.DataAnnotations
System.Configuration
System.Configuration.Install
System.Core
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Linq
System.Data.OracleClient
Assembly
System.Data.OracleClient
System.Data.OracleClient.Oci
Test
System.Data.OracleClient
System.Data.OracleClient.Oci
System.Data.OracleClient.jvm
MonoTests.System.Data.Utils
OracleCommand
OracleCommandBuilder
OracleConnection
IDBConnection_For_Oracle.cs
OracleConnection_BeginTransaction.cs
OracleConnection_ChangeDatabase.cs
OracleConnection_Close.cs
OracleConnection_ConnectionString.cs
OracleConnection_ConnectionTimeout.cs
OracleConnection_CreateCommand.cs
OracleConnection_DataSource.cs
OracleConnection_Database.cs
OracleConnection_Equals.cs
OracleConnection_InfoMessage.cs
OracleConnection_New.cs
OracleConnection_State.cs
OracleConnection_StateChange.cs
OracleDataAdapter
OracleDataReader
OracleParameter
OracleParameterCollection
OracleTransaction
OracleType
TestOracleClient.cs.REMOVED.git-id
refcursortest.cs
testblob.cs
testclob.cs
Makefile
System.Data.OracleClient.dll.sources
System.Data.OracleClient_test.dll.sources
System.Data.Services
System.Data.Services.Client
System.Deployment
System.Design
System.DirectoryServices
System.DirectoryServices.Protocols
System.Drawing
System.Drawing.Design
System.Dynamic
System.EnterpriseServices
System.IO.Compression
System.IO.Compression.FileSystem
System.IdentityModel
System.IdentityModel.Selectors
System.Json
System.Json.Microsoft
System.Management
System.Messaging
System.Net
System.Net.Http
System.Net.Http.Formatting
System.Net.Http.WebRequest
System.Net.Http.WinHttpHandler
System.Numerics
System.Numerics.Vectors
System.Reactive.Core
System.Reactive.Debugger
System.Reactive.Experimental
System.Reactive.Interfaces
System.Reactive.Linq
System.Reactive.Observable.Aliases
System.Reactive.PlatformServices
System.Reactive.Providers
System.Reactive.Runtime.Remoting
System.Reactive.Windows.Forms
System.Reactive.Windows.Threading
System.Reflection.Context
System.Runtime.Caching
System.Runtime.CompilerServices.Unsafe
System.Runtime.DurableInstancing
System.Runtime.Remoting
System.Runtime.Serialization
System.Runtime.Serialization.Formatters.Soap
System.Security
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.Web
System.ServiceProcess
System.Threading.Tasks.Dataflow
System.Transactions
System.Web
System.Web.Abstractions
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Extensions
System.Web.Extensions.Design
System.Web.Http
System.Web.Http.SelfHost
System.Web.Http.WebHost
System.Web.Mobile
System.Web.Mvc3
System.Web.Razor
System.Web.RegularExpressions
System.Web.Routing
System.Web.Services
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
System.Windows
System.Windows.Forms
System.Windows.Forms.DataVisualization
System.Workflow.Activities
System.Workflow.ComponentModel
System.Workflow.Runtime
System.XML
System.Xaml
System.Xml.Linq
System.Xml.Serialization
SystemWebTestShim
WebMatrix.Data
WindowsBase
aot-compiler
corlib
dlr
doc
legacy
lib
monodoc
notes
reference-assemblies
referencesource
test-helpers
LICENSE
Makefile
Open.snk
README
ecma.pub
mono.pub
mono.snk
msfinal.pub
reactive.pub
silverlight.pub
winfx.pub
winfx3.pub
docs
errors
ilasm
jay
mcs
packages
tests
tools
AUTHORS
COPYING
INSTALL.txt
Makefile
MonoIcon.png
README
ScalableMonoIcon.svg
mkinstalldirs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
162 lines
4.4 KiB
C#
162 lines
4.4 KiB
C#
![]() |
//
|
||
|
// Copyright (c) 2006 Mainsoft Co.
|
||
|
//
|
||
|
// Permission is hereby granted, free of charge, to any person obtaining
|
||
|
// a copy of this software and associated documentation files (the
|
||
|
// "Software"), to deal in the Software without restriction, including
|
||
|
// without limitation the rights to use, copy, modify, merge, publish,
|
||
|
// distribute, sublicense, and/or sell copies of the Software, and to
|
||
|
// permit persons to whom the Software is furnished to do so, subject to
|
||
|
// the following conditions:
|
||
|
//
|
||
|
// The above copyright notice and this permission notice shall be
|
||
|
// included in all copies or substantial portions of the Software.
|
||
|
//
|
||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||
|
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||
|
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||
|
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||
|
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
|
//
|
||
|
|
||
|
using System;
|
||
|
using System.Data;
|
||
|
using System.Data.OracleClient ;
|
||
|
|
||
|
using MonoTests.System.Data.Utils;
|
||
|
|
||
|
|
||
|
using NUnit.Framework;
|
||
|
|
||
|
namespace MonoTests.System.Data.OracleClient
|
||
|
{
|
||
|
[TestFixture]
|
||
|
public class OracleConnection_BeginTransaction : ADONetTesterClass
|
||
|
{
|
||
|
Exception exp = null;
|
||
|
OracleConnection con = null;
|
||
|
OracleTransaction tran = null;
|
||
|
|
||
|
public static void Main()
|
||
|
{
|
||
|
OracleConnection_BeginTransaction tc = new OracleConnection_BeginTransaction();
|
||
|
Exception exp = null;
|
||
|
try
|
||
|
{
|
||
|
tc.BeginTest("OracleConnection_BeginTransaction");
|
||
|
tc.run();
|
||
|
}
|
||
|
catch(Exception ex){exp = ex;}
|
||
|
finally {tc.EndTest(exp);}
|
||
|
}
|
||
|
|
||
|
[SetUp]
|
||
|
public void SetUp() {
|
||
|
con = new OracleConnection(MonoTests.System.Data.Utils.ConnectedDataProvider.ConnectionString);
|
||
|
con.Open();
|
||
|
}
|
||
|
|
||
|
[TearDown]
|
||
|
public void TearDown() {
|
||
|
if (con != null && con.State == ConnectionState.Open) con.Close();
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
#if JAVA
|
||
|
[Category("NotWorking")]
|
||
|
#endif
|
||
|
public void TestBeginTransactionChaos() {
|
||
|
|
||
|
DataBaseServer dbType = ConnectedDataProvider.GetDbType(con);
|
||
|
// not supported on DB2 and Oracle and Sybase
|
||
|
if (dbType != DataBaseServer.Oracle && dbType != DataBaseServer.DB2 && dbType != DataBaseServer.Sybase) {
|
||
|
con.Close();
|
||
|
con.Open();
|
||
|
try {
|
||
|
BeginCase("BeginTransaction - IsolationLevel Chaos");
|
||
|
tran = con.BeginTransaction(IsolationLevel.Chaos);
|
||
|
Compare(tran == null, false);
|
||
|
}
|
||
|
catch(Exception ex){exp = ex;}
|
||
|
finally{EndCase(exp); exp = null;}
|
||
|
}
|
||
|
/* not supported by MSSQL,DB2,Oracle
|
||
|
con.Close();
|
||
|
con.Open();
|
||
|
try
|
||
|
{
|
||
|
BeginCase("BeginTransaction - IsolationLevel Unspecified");
|
||
|
tran = con.BeginTransaction(IsolationLevel.Unspecified );
|
||
|
Compare(tran == null, false);
|
||
|
}
|
||
|
catch(Exception ex){exp = ex;}
|
||
|
finally{EndCase(exp); exp = null;}
|
||
|
*/
|
||
|
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void run()
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
BeginCase("BeginTransaction");
|
||
|
tran = con.BeginTransaction();
|
||
|
Compare(tran == null, false);
|
||
|
}
|
||
|
catch(Exception ex){exp = ex;}
|
||
|
finally{EndCase(exp); exp = null;}
|
||
|
con.Close();
|
||
|
con.Open();
|
||
|
try
|
||
|
{
|
||
|
BeginCase("BeginTransaction - IsolationLevel ReadCommitted");
|
||
|
tran = con.BeginTransaction(IsolationLevel.ReadCommitted);
|
||
|
Compare(tran == null, false);
|
||
|
}
|
||
|
catch(Exception ex){exp = ex;}
|
||
|
finally{EndCase(exp); exp = null;}
|
||
|
|
||
|
|
||
|
DataBaseServer dbType = ConnectedDataProvider.GetDbType(con);
|
||
|
|
||
|
//Not supported by JDBC driver for oracle
|
||
|
if (dbType != DataBaseServer.Oracle)
|
||
|
{
|
||
|
con.Close();
|
||
|
con.Open();
|
||
|
try
|
||
|
{
|
||
|
BeginCase("BeginTransaction - IsolationLevel ReadUncommitted");
|
||
|
tran = con.BeginTransaction(IsolationLevel.ReadUncommitted );
|
||
|
Compare(tran == null, false);
|
||
|
}
|
||
|
catch(Exception ex){exp = ex;}
|
||
|
finally{EndCase(exp); exp = null;}
|
||
|
|
||
|
con.Close();
|
||
|
con.Open();
|
||
|
try
|
||
|
{
|
||
|
BeginCase("BeginTransaction - IsolationLevel RepeatableRead");
|
||
|
tran = con.BeginTransaction(IsolationLevel.RepeatableRead);
|
||
|
Compare(tran == null, false);
|
||
|
}
|
||
|
catch(Exception ex){exp = ex;}
|
||
|
finally{EndCase(exp); exp = null;}
|
||
|
con.Close();
|
||
|
con.Open();
|
||
|
try
|
||
|
{
|
||
|
BeginCase("BeginTransaction - IsolationLevel Serializable");
|
||
|
tran = con.BeginTransaction(IsolationLevel.Serializable );
|
||
|
Compare(tran == null, false);
|
||
|
}
|
||
|
catch(Exception ex){exp = ex;}
|
||
|
finally{EndCase(exp); exp = null;}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|