chenxicxc / mybatisnet

Automatically exported from code.google.com/p/mybatisnet
0 stars 0 forks source link

Can't host ibatis in WCF IIS site without asp.net compat. #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Can't host ibatis in WCF IIS site without asp.net compat.

Original issue reported on code.google.com by mmccur...@gmail.com on 30 Jul 2010 at 7:08

GoogleCodeExporter commented 8 years ago
How so? I use IBatis in several WCF services not in ASP.NET 2.0 compatibility 
mode. Just make sure all of the resources are embedded and you should be fine. 
Or are you asking for support for non-embedded resources in a WCF solution?

Original comment by consultc...@gmail.com on 31 Aug 2010 at 6:51

GoogleCodeExporter commented 8 years ago
Which transport type are you using ?  I've seen problems getting the session 
when the wcf services are hosting on IIS 6 when it attempts to use the 
WebSession Manager due to the site not having there not being a web session.

Original comment by mmccur...@gmail.com on 31 Aug 2010 at 11:28

GoogleCodeExporter commented 8 years ago
The WCF services I've built also run on IIS 6. You can run iBatis without an 
HttpContext if you do the following when you initialize your mapper(s) (VB.NET):

    Protected Sub InitMapper(ByRef mapper As ISqlMapper, ByVal embeddedResource As String)

        Dim builder As New DomSqlMapBuilder()

        Dim properties As New NameValueCollection()
        properties.Add("connectionString", Me.ConnectionString)
        builder.Properties = properties

        mapper = builder.Configure(Resources.GetEmbeddedResourceAsXmlDocument(embeddedResource))
        mapper.SessionStore = New HybridWebThreadSessionStore(mapper.Id)

    End Sub

The "HybridWebThreadSessionStore" will allow you to run iBatis outside the 
context of a web session. This also allows us to use iBatis queries as a 
datasource for SSRS reports and other things that don't use a web session.

Original comment by consultc...@gmail.com on 1 Sep 2010 at 6:37

GoogleCodeExporter commented 8 years ago
The 1.6.2 version and later version has resolve this problem underlying.

Original comment by yanfabu_...@163.com on 6 Jul 2012 at 2:35