Bug #46375 | MySql.Web.Profile.MySQLProfileProvider does not work properly with Mono | ||
---|---|---|---|
Submitted: | 24 Jul 2009 16:34 | Modified: | 4 Aug 2009 16:20 |
Reporter: | Mark Walmsley | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 6.0.4.0 | OS: | Linux (SuSE 11.1) |
Assigned to: | Reggie Burnett | CPU Architecture: | Any |
Tags: | Connector/Net, Mono, MySQLProfileProvider |
[24 Jul 2009 16:34]
Mark Walmsley
[25 Jul 2009 16:06]
Mark Walmsley
As far as I can tell there are 2 bugs ... 1. Mono's Profile Auto-Saving does not seem to call MySQLProfileProvider.SetPropertyValues() when Profile.Name is set. I need to call Profile.Save() explicitly to get this function called. 2. In MySQLProfileProvider.SetPropertyValues() the line : using (TransactionScope ts = new TransactionScope()) throws an exception ... things work okay after commenting out this line and the following line: ts.Complete(); This exception may be my problem for running an older version (5.1.34) of MySql ???
[26 Jul 2009 11:28]
Mark Walmsley
Not so serious ...
[27 Jul 2009 6:58]
Tonci Grgin
Hi Mark and thanks for your report. I do not know what to do with it. Have you checked mono does support "EnlistTransactions"? Because of: System.NotImplementedException: The requested feature is not implemented. at MySql.Data.MySqlClient.MySqlConnection.EnlistTransaction (System.Transactions.Transaction transaction) [0x00000] I'd start from there... Really doesn't appear to be our bug as it should be supported: http://msdn.microsoft.com/en-us/library/system.data.common.dbconnection.enlisttransaction....
[27 Jul 2009 9:23]
Mark Walmsley
I suspect the bugs are just due to my particular setup ... I'm using MyISAM tables which do not support transactions. However, the MySQLMembershipProvider uses transaction = connection.BeginTransaction() plus transaction.Commit() or transaction.Rollback() instead of ts = new TransactionScope() plus ts.Complete() in MySQLRoleProvider and MySQLProfileProvider ... and MySQLMembershipProvider runs fine without exceptions.
[27 Jul 2009 12:16]
Mark Walmsley
What I mean to say is that (since I can live without transactions) I'm able to work around the problem by just commenting out the transaction support and re-building the providers ... . ... but BeginTransaction() seems to silently ignore the lack of transaction support in the database (whereas TransactionScope does not), and if BeginTransaction() was used in the official MySql providers (instead of TransactionScope) then anyone could use your providers directly, whether they wanted to work with a database engine that supports transactions or not.
[3 Aug 2009 7:33]
Tonci Grgin
Mark, you are probably right, must consult others on this change.
[3 Aug 2009 9:48]
Tonci Grgin
Mark, TransactionScope and Transaction are not the same thing. Transaction scope is more like XA, i.e you can set the scope and do transaction against multiple/heterogenous databases. When something is aborted during this time, every participating transaction is aborted, or similar. Mono support for this is limited (as described in http://www.mono-project.com/Transactions) thus we do not support everything on Mono (for example, EnlistTransaction is surrounded by #if !MONO && !CF) hence you seem to have problems instantiating TransactionScope. So I'm not exactly sure what how to rule this report... Maybe we could enable remarked code in driver and just let Mono throw "NotImplemeted". But that's for Reggie to decide.
[3 Aug 2009 14:58]
Mark Walmsley
How about a configuration option (like autoGenerateSchema or writeExceptionsToEventLog) to turn transaction support in the providers on or off?
[4 Aug 2009 13:49]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/80027 703 Reggie Burnett 2009-08-04 removed usage of TransactionScope from web providers so that they work properly on Mono 2.0 (bug #46375)
[4 Aug 2009 13:58]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/80039 703 Reggie Burnett 2009-08-04 removed usage of TransactionScope from web providers so that they work properly on Mono 2.0 (bug #46375)
[4 Aug 2009 14:04]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/80041 703 Reggie Burnett 2009-08-04 removed usage of TransactionScope from web providers so that they work properly on Mono 2.0 (bug #46375)
[4 Aug 2009 14:13]
Reggie Burnett
fixed in 5.2.8, 6.0.5, and 6.1.1+
[4 Aug 2009 16:20]
Tony Bedford
Entries were added to the 5.2.8, 6.0.5 and 6.1.1 changelogs: The MySQL Connector/NET Profile Provider, MySql.Web.Profile.MySQLProfileProvider, generated an error when running on Mono. When an attempt was made to save a string in Profile.Name the string was not saved to the my_aspnet_Profiles table. If an attempt was made to force the save with Profile.Save() the following error was generated: Server Error in '/mono' Application -------------------------------------------------------------------------------- The requested feature is not implemented. Description: HTTP 500. Error processing request. Stack Trace: System.NotImplementedException: The requested feature is not implemented. at MySql.Data.MySqlClient.MySqlConnection.EnlistTransaction (System.Transactions.Transaction transaction) [0x00000] at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000] at MySql.Web.Profile.MySQLProfileProvider.SetPropertyValues (System.Configuration.SettingsContext context, System.Configuration.SettingsPropertyValueCollection collection) [0x00000] -------------------------------------------------------------------------------- Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433