Coder Social home page Coder Social logo

shuttle / shuttle.core.data Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 7.0 1.09 MB

Provides an abstraction over ADO.NET.

Home Page: http://shuttle.github.io/shuttle-core

License: BSD 3-Clause "New" or "Revised" License

C# 100.00%
orm data-access micro-orm

shuttle.core.data's People

Contributors

eben-roux avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shuttle.core.data's Issues

- create basic mapping

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));
   }
}

problem with enlisting in the existing transaction scope

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.

Change IDatabaseContextCache Get/Contains

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.