[seasar-dotnet:1581] S2Dao.netによるトランザクションの拡張について
MOTO FUJI
[E-MAIL ADDRESS DELETED]
2010年 3月 12日 (金) 18:20:06 JST
はじめまして、FUJIといいます。
VB.NETを利用しているのですが、トランザクションがかからずに困っています。
アドバイスを頂けないでしょうか。
WebサービスからDAOのメソッドを呼び出し、データをINSERTする処理になっています。
外部ファイルに記述されたINSERT文を発行するのですが発行後、データの追加できるのですが、
2件目のデータを追加する際に、エラーを発生させるとロールバックされずに1件目のデータが
追加された状態となっています。※ストアドで追加を行っても同じ現象が発生しました。
DAOのInsertDataメソッドに<Transaction()>を指定した場合は、上記のように1件目が
登録されると思うのですが、<Transaction()>はクラスに指定を行っているので、
ロールバックされると思っていたのですが誤りでしょうか?
//DAO Start
Imports Seasar.Dao.Attrs
Imports Seasar.Quill.Attrs
<Implementation()> _
<S2Dao()> _
<Transaction()> _
<Bean(GetType(SampleDto))> _
Public Interface SampleDao
<SqlFile()> _
Function InsertData(ByVal InsData As SampleDto) As Boolean
End Interface
//DAO End
------------------------------------------------------------------------------------------
//DTO Start
Imports Seasar.Dao.Attrs
Namespace Sample
Public Class SampleDto
Public Property TelNumber() As String
Get
Return _TelNumber
End Get
Set(ByVal value As String)
_TelNumber = value
End Set
End Property
//DTO End
------------------------------------------------------------------------------------------
//WEBサービス Start
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports Seasar.Quill
Imports Seasar.Quill.Attrs
Imports System.Security.Cryptography
Imports System.Collections.Generic
<WebService(Namespace:="http://localhost.WebService/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService01
Inherits System.Web.Services.WebService
Protected daoOfSample As SampleDao
Private Function ImportData(ByVal _strTelnumber As String) As Boolean
Dim dto(2) as SampleDto
dto(0).TelNumber = "090-xxxx-xxxx"
dto(1).TelNumber = "080-xxxx-xxxx"
For i as integer = 0 To dto.Length -1
daoOfSample.InsertData(dto(i))
Next
End Sub
//WEBサービス End
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: <http://ml.seasar.org/archives/seasar-dotnet/attachments/20100312/cefb4b7d/attachment.html>
seasar-dotnet メーリングリストの案内