shuttle / shuttle.core.data Goto Github PK
View Code? Open in Web Editor NEWProvides an abstraction over ADO.NET.
Home Page: http://shuttle.github.io/shuttle-core
License: BSD 3-Clause "New" or "Revised" License
Provides an abstraction over ADO.NET.
Home Page: http://shuttle.github.io/shuttle-core
License: BSD 3-Clause "New" or "Revised" License
Add onto the IDatabaseGateway
:
T Map<T>(IQuery query) where T : new();
This should do a best guess to create the type and set any matching public properties.
Or perhaps create a default mapper:
public static class Mapper
{
public static T Map<T>(DataRow row) where T : new()
{
...
}
public static T Map<T>(this IDatabaseGateway databaseGateway, IQuery query)
{
return Mapper.Map<T>(databaseGateway.GetSingleRowUsing(query));
}
}
Hi.
We wrote unit test for shuttle publish to check if it can be enlisted in trasnaction scope without promoting DTC. This is the code of the test
using (var scope = new TransactionScope(TransactionScopeOption.Required))
{
using (var sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings[0].ConnectionString))
using (var command = new SqlCommand("INSERT INTO Test VALUES(@Description)", sqlConnection))
{
command.Parameters.Add("Description", SqlDbType.VarChar, 100).Value = DateTime.UtcNow.Millisecond.ToString();
_bus.Publish(new TestMessage() { FreeText = "Milan Svitlica" });
sqlConnection.Open();
command.ExecuteNonQuery();
scope.Complete();
}
}`
But when executing on Sql server 2014, we got an error
24.08.2016 10:01:09:51380 117 Fatal Unhandled exception during event 'Shuttle.Esb.OnDispatchTransportMessage': Raising pipeline event 'Shuttle.Esb.OnDispatchTransportMessage' in stage 'Send' for observer 'Shuttle.Esb.DispatchTransportMessageObserver'. / Exception has been thrown by the target of an invocation. / Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool. / The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)
24.08.2016 10:01:09:53080 69 Error Shuttle.Core.Infrastructure.PipelineException: Raising pipeline event 'Shuttle.Esb.OnDispatchTransportMessage' in stage 'Send' for observer 'Shuttle.Esb.DispatchTransportMessageObserver'. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool. ---> System.Runtime.InteropServices.COMException: The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT:
Could you provide any advice here ? We would like to enlist shuttle publish in ambient transaction without promoting DTC since both our code and shuttle are using same database.
Currently IDatabaseContextCache.Get
and IDatabaseContextCache.Contains
uses a connection string to find the relevant context. This is somewhat conter-intuituve so for v11.0.0 it will be changed to use the name.
New methods (GetConnectionString
and ContainsConnectionString
) will be used to retrieve the relevant context using the connection string.
The query mapper can use a generic row mapper that does the actual mapping. Thw row mapper can be used when dealing with rows only.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.