зеркало из https://github.com/mono/mail-archives.git
449 строки
17 KiB
HTML
449 строки
17 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Mono-bugs] [Bug 553307] New: Datasets and Dataadapters are absolutely not behaving like in Microsoft.Net!
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20553307%5D%20New%3A%20Datasets%20and%20Dataadapters%20are%0A%20absolutely%20not%20behaving%20like%20in%20Microsoft.Net%21&In-Reply-To=">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="095251.html">
|
|
<LINK REL="Next" HREF="095084.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Mono-bugs] [Bug 553307] New: Datasets and Dataadapters are absolutely not behaving like in Microsoft.Net!</H1>
|
|
<B>bugzilla_noreply at novell.com</B>
|
|
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20553307%5D%20New%3A%20Datasets%20and%20Dataadapters%20are%0A%20absolutely%20not%20behaving%20like%20in%20Microsoft.Net%21&In-Reply-To="
|
|
TITLE="[Mono-bugs] [Bug 553307] New: Datasets and Dataadapters are absolutely not behaving like in Microsoft.Net!">bugzilla_noreply at novell.com
|
|
</A><BR>
|
|
<I>Fri Nov 6 10:35:02 EST 2009</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="095251.html">[Mono-bugs] [Bug 553306] [verifier] SIGSEGV in mono_class_init on a bad assembly
|
|
</A></li>
|
|
<LI>Next message: <A HREF="095084.html">[Mono-bugs] [Bug 553307] Datasets and Dataadapters are absolutely not behaving like in Microsoft.Net!
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#94744">[ date ]</a>
|
|
<a href="thread.html#94744">[ thread ]</a>
|
|
<a href="subject.html#94744">[ subject ]</a>
|
|
<a href="author.html#94744">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE><A HREF="http://bugzilla.novell.com/show_bug.cgi?id=553307">http://bugzilla.novell.com/show_bug.cgi?id=553307</A>
|
|
|
|
|
|
Summary: Datasets and Dataadapters are absolutely not behaving
|
|
like in Microsoft.Net!
|
|
Classification: Mono
|
|
Product: Mono: Class Libraries
|
|
Version: 2.4.x
|
|
Platform: i686
|
|
OS/Version: openSUSE 11.2
|
|
Status: NEW
|
|
Severity: Major
|
|
Priority: P5 - None
|
|
Component: Sys.Data
|
|
AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">bnc-blr-team-mono at forge.provo.novell.com</A>
|
|
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">jhmgbl2 at t-online.de</A>
|
|
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
|
|
Found By: ---
|
|
|
|
|
|
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.11)
|
|
Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
|
|
|
|
I've tried for days getting a database application to work under Mono, but
|
|
everytime I make a workaround, a new error is occurring, which does not exist
|
|
under .Net!
|
|
|
|
Here is my Main piece of Code where most Errors occur:
|
|
|
|
Public Sub FilldsPPT(ByVal ParentCategoryID As Long, ByVal ParentCategoryRow As
|
|
dsPP.ParentCategoriesRow, Optional ByRef DTrans As Sqlite.SqliteTransaction =
|
|
Nothing, Optional ByVal Recurse As Boolean = False, Optional ByRef
|
|
InternalRecurse As Boolean = False)
|
|
Const CodeLoc As String = "clsDBPP.FilldsPPT"
|
|
gStatus = CodeLoc & " Start PCat: " & ParentCategoryID
|
|
Dim qry As String
|
|
Dim Param As SqliteParameter
|
|
Dim blnCloseConnection As Boolean
|
|
_Initializing = True
|
|
Try
|
|
|
|
retry:
|
|
|
|
Me.DataSetName = "dsPP"
|
|
|
|
If (ConPP.State) = ConnectionState.Closed Then
|
|
ConPP.Open()
|
|
blnCloseConnection = True
|
|
End If
|
|
|
|
' *************** Pictures ***************
|
|
gStatus = CodeLoc & " Fill Pictures"
|
|
qry = "Select * FROM Pictures WHERE ID IN " & _
|
|
"(Select PictureID FROM CategoriesOfPictures WHERE
|
|
CategoryID IN " & _
|
|
"(Select CategoryID FROM ParentCategories WHERE
|
|
ParentCategoryID = ?))"
|
|
gStatus = CodeLoc & " Fill Pictures Create Command"
|
|
Using cmd As New SqliteCommand(qry, ConPP)
|
|
cmd.Transaction = DTrans
|
|
gStatus = CodeLoc & " Fill Pictures Add Parameter"
|
|
Param = cmd.Parameters.Add("@CategoryID", DbType.Int32, 4)
|
|
Param.Direction = ParameterDirection.Input
|
|
Param.Value = ParentCategoryID
|
|
gStatus = CodeLoc & " Fill Pictures Create Adapter"
|
|
Using da As New SqliteDataAdapter(cmd)
|
|
#If Not Linux Then
|
|
da.Fill(Me, "Pictures")
|
|
#Else
|
|
gStatus = CodeLoc & " Fill Pictures Getting Rowcount"
|
|
If Me.Pictures.Rows.Count > 0 Then
|
|
gStatus = CodeLoc & " Fill tmpPictures"
|
|
Me.EnforceConstraints = False
|
|
da.Fill(_dsTMP, "tmpPictures")
|
|
Dim RowCount As Integer = _dsTMP.Tables("tmpPictures").Rows.Count
|
|
gStatus = CodeLoc & " Filled tmpPictures count: " & RowCount
|
|
If RowCount > 0 Then
|
|
gStatus = CodeLoc & " Fill Pictures Set Constraints and Delete
|
|
Rules"
|
|
Me.EnforceConstraints = False
|
|
If Me.relationCat_CatOPics IsNot Nothing AndAlso
|
|
Me.relationCat_CatOPics.ChildKeyConstraint IsNot Nothing Then
|
|
Me.relationPics_CatOPics.ChildKeyConstraint.DeleteRule =
|
|
Rule.None
|
|
Me.relationThumbs_Pictures.ChildKeyConstraint.DeleteRule =
|
|
Rule.None
|
|
End If
|
|
gStatus = CodeLoc & " Browse Rows RowCount: " & RowCount
|
|
Dim first As Boolean = True
|
|
For Each r As DataRow In _dsTMP.Tables("tmpPictures").Rows
|
|
|
|
If first Then
|
|
gStatus = CodeLoc & " Browse Rows Start"
|
|
first = False
|
|
End If
|
|
Dim drPics As dsPP.PicturesRow =
|
|
Me.Pictures.FindByID(CLng(r!ID))
|
|
If drPics IsNot Nothing Then
|
|
gStatus = CodeLoc & " Not Importing PicRow " & drPics.Name
|
|
Else
|
|
gStatus = CodeLoc & " Importing PicRow " & CStr(r!Name)
|
|
Me.Pictures.ImportRow(r)
|
|
End If
|
|
Next
|
|
If Me.relationCat_CatOPics IsNot Nothing AndAlso
|
|
Me.relationCat_CatOPics.ChildKeyConstraint IsNot Nothing Then
|
|
Me.relationPics_CatOPics.ChildKeyConstraint.DeleteRule =
|
|
Rule.Cascade
|
|
Me.relationThumbs_Pictures.ChildKeyConstraint.DeleteRule =
|
|
Rule.Cascade
|
|
End If
|
|
gStatus = CodeLoc & " EnforceConstraints"
|
|
|
|
|
|
End If
|
|
gStatus = CodeLoc & "Clear tmpPictures"
|
|
_dsTMP.Tables.Remove("tmpPictures")
|
|
Me.EnforceConstraints = True
|
|
Else
|
|
da.Fill(Me, "Pictures")
|
|
End If
|
|
#End If
|
|
|
|
End Using
|
|
End Using
|
|
|
|
'********************* Categories *************************
|
|
gStatus = CodeLoc & " Fill Categories"
|
|
qry = "Select * FROM Categories WHERE ID IN (Select CategoryID FROM
|
|
ParentCategories WHERE ParentCategoryID = ?)"
|
|
Using cmd As New SqliteCommand(qry, ConPP)
|
|
cmd.Transaction = DTrans
|
|
Param = cmd.Parameters.Add("@CategoryID", DbType.Int32, 4)
|
|
Param.Direction = ParameterDirection.Input
|
|
Param.Value = ParentCategoryID
|
|
Using da As New SqliteDataAdapter(cmd)
|
|
#If Not Linux Then
|
|
da.Fill(Me, "Categories")
|
|
#Else
|
|
If Me.Categories.Rows.Count > 0 Then
|
|
Me.EnforceConstraints = False
|
|
da.Fill(_dsTMP, "tmpCategories")
|
|
Dim RowCount As Integer = _dsTMP.Tables("tmpCategories").RowsCount
|
|
If RowCount > 0 Then
|
|
If Me.relationParentCatCat_Cat IsNot Nothing AndAlso
|
|
Me.relationParentCatCat_Cat.ChildKeyConstraint IsNot Nothing Then
|
|
Me.relationParentCatCat_Cat.ChildKeyConstraint.DeleteRule =
|
|
Rule.None
|
|
Me.relationParentCatParentCat_Cat.ChildKeyConstraint.DeleteRule
|
|
= Rule.None
|
|
Me.relationCat_CatOPics.ChildKeyConstraint.DeleteRule =
|
|
Rule.None
|
|
End If
|
|
Me.EnforceConstraints = False
|
|
For Each r As DataRow In _dsTMP.Tables("tmpCategories").Rows
|
|
Dim drCategories As dsPP.CategoriesRow =
|
|
Me.Categories.FindByID(CLng(r!ID))
|
|
If drCategories IsNot Nothing Then
|
|
Else
|
|
Me.Categories.ImportRow(r)
|
|
End If
|
|
Next
|
|
If Me.relationParentCatCat_Cat IsNot Nothing AndAlso
|
|
Me.relationParentCatCat_Cat.ChildKeyConstraint IsNot Nothing Then
|
|
Me.relationParentCatCat_Cat.ChildKeyConstraint.DeleteRule =
|
|
Rule.Cascade
|
|
Me.relationParentCatParentCat_Cat.ChildKeyConstraint.DeleteRule
|
|
= Rule.Cascade
|
|
Me.relationCat_CatOPics.ChildKeyConstraint.DeleteRule =
|
|
Rule.Cascade
|
|
End If
|
|
|
|
|
|
End If
|
|
_dsTMP.Tables.Remove("tmpCategories")
|
|
Me.EnforceConstraints = True
|
|
Else
|
|
da.Fill(Me, "Categories")
|
|
End If
|
|
#End If
|
|
|
|
End Using
|
|
End Using
|
|
|
|
|
|
'*****************CatOPics************************
|
|
gStatus = CodeLoc & " Fill CatOPics"
|
|
qry = "Select * FROM CategoriesOfPictures WHERE CategoryID IN " & _
|
|
"(Select CategoryID FROM ParentCategories WHERE
|
|
ParentCategoryID = ?)"
|
|
Using cmd As New SqliteCommand(qry, ConPP)
|
|
cmd.Transaction = DTrans
|
|
Param = cmd.Parameters.Add("@CategoryID", DbType.Int32, 4)
|
|
Param.Direction = ParameterDirection.Input
|
|
Param.Value = ParentCategoryID
|
|
Using da As New SqliteDataAdapter(cmd)
|
|
#If Not Linux Then
|
|
da.Fill(Me, "CategoriesOfPictures")
|
|
#Else
|
|
If Me.CategoriesOfPictures.Rows.Count > 0 Then
|
|
Me.EnforceConstraints = False
|
|
da.Fill(_dsTMP, "tmpCategoriesOfPictures")
|
|
For Each r As DataRow In
|
|
_dsTMP.Tables("tmpCategoriesOfPictures").Rows
|
|
Dim drCategoriesOfPictures As dsPP.CategoriesOfPicturesRow =
|
|
Me.CategoriesOfPictures.FindByID(CLng(r!ID))
|
|
If drCategoriesOfPictures IsNot Nothing Then
|
|
|
|
'Me.CategoriesOfPictures.RemoveCategoriesOfPicturesRow(drCategoriesOfPictures)
|
|
Else
|
|
Me.CategoriesOfPictures.ImportRow(r)
|
|
End If
|
|
Next
|
|
_dsTMP.Tables.Remove("tmpCategoriesOfPictures")
|
|
Me.EnforceConstraints = True
|
|
Else
|
|
da.Fill(Me, "CategoriesOfPictures")
|
|
End If
|
|
#End If
|
|
End Using
|
|
End Using
|
|
' *********************ParentCategories*********************
|
|
gStatus = CodeLoc & " Fill ParentCategories"
|
|
qry = "Select * FROM ParentCategories WHERE ParentCategoryID = ?"
|
|
Using cmd As New SqliteCommand(qry, ConPP)
|
|
cmd.Transaction = DTrans
|
|
Param = cmd.Parameters.Add("@CategoryID", DbType.Int32, 4)
|
|
Param.Direction = ParameterDirection.Input
|
|
Param.Value = ParentCategoryID
|
|
Using da As New SqliteDataAdapter(cmd)
|
|
Dim Retrys As Integer
|
|
Try
|
|
|
|
RetryFillPCat:
|
|
#If Not Linux Then
|
|
da.Fill(Me, "ParentCategories")
|
|
#Else
|
|
If Me.ParentCategories.Rows.Count > 0 Then
|
|
Me.EnforceConstraints = False
|
|
da.Fill(_dsTMP, "tmpParentCategories")
|
|
For Each r As DataRow In
|
|
_dsTMP.Tables("tmpParentCategories").Rows
|
|
Dim drParentCategories As dsPP.ParentCategoriesRow =
|
|
Me.ParentCategories.FindByID(CLng(r!ID))
|
|
If drParentCategories IsNot Nothing Then
|
|
|
|
'Me.ParentCategories.RemoveParentCategoriesRow(drParentCategories)
|
|
Else
|
|
Me.ParentCategories.ImportRow(r)
|
|
End If
|
|
Next
|
|
_dsTMP.Tables.Remove("tmpParentCategories")
|
|
Me.EnforceConstraints = True
|
|
Else
|
|
da.Fill(Me, "ParentCategories")
|
|
End If
|
|
#End If
|
|
Catch ex As ConstraintException
|
|
gStatus = CodeLoc & " Fill ParentCategories Constraintexception"
|
|
RemoveNonExistentEntrysFROMParentCategories()
|
|
Retrys += 1
|
|
' Da die Einträge trotz Fehlers geladen werden müssen sie vor einem
|
|
erneuten Versuch erst gelöscht werden.
|
|
For Each r As DataRow In
|
|
Me.ParentCategories.Select("ParentCategoryID = " & ParentCategoryID)
|
|
Me.ParentCategories.Rows.Remove(r)
|
|
Next
|
|
#If Linux Then
|
|
If _dsTMP.Tables("tmpParentCategories") IsNot Nothing Then
|
|
_dsTMP.Tables.Remove("tmpParentCategories")
|
|
End If
|
|
#End If
|
|
Me.EnforceConstraints = True
|
|
If Retrys < 2 Then GoTo RetryFillPCat
|
|
RemoveDoubleEntriesFromParentCategories()
|
|
If Retrys < 3 Then GoTo RetryfillpCat
|
|
End Try
|
|
End Using
|
|
End Using
|
|
''***********************Thumbs*************************
|
|
'qry = "Select * FROM Thumbs where PictureID IN " & _
|
|
' "(Select ID FROM Pictures WHERE ID IN " & _
|
|
' "(Select PictureID FROM CategoriesOfPictures WHERE
|
|
CategoryID IN " & _
|
|
' "(Select CategoryID FROM ParentCategories WHERE
|
|
ParentCategoryID = ?)))"
|
|
'Using cmd As New SQLiteCommand(qry, ConPP)
|
|
' Param = cmd.Parameters.Add("@CategoryID", DbType.Int32, 4)
|
|
' Param.Direction = ParameterDirection.Input
|
|
' Param.Value = ParentCategoryID
|
|
' Using da As New SQLiteDataAdapter(cmd)
|
|
' da.Fill(Me, "Thumbs")
|
|
' End Using
|
|
'End Using
|
|
'***********************FavFolder*************************
|
|
gStatus = CodeLoc & " Fill FavFolder"
|
|
If Me.FavFolder.Count = 0 Then
|
|
Using da As New SqliteDataAdapter("Select * FROM FavFolder", ConPP)
|
|
|
|
da.SelectCommand.Transaction = DTrans
|
|
|
|
da.Fill(Me, "FavFolder")
|
|
End Using
|
|
End If
|
|
'***********************Favorites*************************
|
|
gStatus = CodeLoc & " Fill Favorites"
|
|
If Me.Favorites.Count = 0 Then
|
|
Using da As New SqliteDataAdapter("Select * FROM Favorites", ConPP)
|
|
da.SelectCommand.Transaction = DTrans
|
|
da.Fill(Me, "Favorites")
|
|
End Using
|
|
End If
|
|
If Recurse Then
|
|
Static LastPCats As System.Collections.ObjectModel.Collection(Of Long)
|
|
If InternalRecurse = False Then
|
|
LastPCats = New System.Collections.ObjectModel.Collection(Of Long)
|
|
End If
|
|
LastPCats.Add(ParentCategoryID)
|
|
If ParentCategoryRow Is Nothing Then
|
|
Throw New ApplicationException("ParentCat is nothing on recurse!")
|
|
End If
|
|
For Each PCat As dsPP.ParentCategoriesRow In
|
|
ParentCategoryRow.CategoriesRowByParentCatCat_Cat.GetParentCategoriesRowsByParentCatParentCat_Cat
|
|
If Not LastPCats.Contains(PCat.CategoryID) Then
|
|
FilldsPPT(PCat.CategoryID, PCat, DTrans, Recurse, True)
|
|
End If
|
|
Next
|
|
End If
|
|
Catch ex As Exception
|
|
HandleError(ex, "dsPP.FillDSPPT")
|
|
Finally
|
|
If blnCloseConnection Then
|
|
ConPP.Close()
|
|
End If
|
|
_Initializing = False
|
|
End Try
|
|
|
|
|
|
End Sub
|
|
|
|
Reproducible: Always
|
|
|
|
Steps to Reproduce:
|
|
1.
|
|
2.
|
|
3.
|
|
|
|
--
|
|
Configure bugmail: <A HREF="http://bugzilla.novell.com/userprefs.cgi?tab=email">http://bugzilla.novell.com/userprefs.cgi?tab=email</A>
|
|
------- You are receiving this mail because: -------
|
|
You are the QA contact for the bug.
|
|
</PRE>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="095251.html">[Mono-bugs] [Bug 553306] [verifier] SIGSEGV in mono_class_init on a bad assembly
|
|
</A></li>
|
|
<LI>Next message: <A HREF="095084.html">[Mono-bugs] [Bug 553307] Datasets and Dataadapters are absolutely not behaving like in Microsoft.Net!
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#94744">[ date ]</a>
|
|
<a href="thread.html#94744">[ thread ]</a>
|
|
<a href="subject.html#94744">[ subject ]</a>
|
|
<a href="author.html#94744">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
|
|
mailing list</a><br>
|
|
</body></html>
|