MySQL Connector/NET - support for transactions under Mono - mysql

Does anyone know how to get MySQL transactions working under Mono?
I'm using MySQL Connector/NET (via Subsonic 3) and it works perfectly under Microsoft .NET. Recently however I tried running the same site under Mono on Ubuntu and it almost works - except I can't seem to get transactions working.
Reading around the Mono/MySQL sites it's not exactly clear what is and isn't supported.
The original problem is a NotImplementedExcetion with call stack like this:
[System.NotImplementedException]: The requested feature is not implemented.
at MySql.Data.MySqlClient.MySqlConnection.EnlistTransaction (System.Transactions.Transaction) <0x00181>
at MySql.Data.MySqlClient.MySqlConnection.Open () <0x00381>
at SubSonic.DataProviders.DbDataProvider.CreateConnection (string) <0x00059>
at SubSonic.DataProviders.DbDataProvider.CreateConnection () <0x00015>
There's a few mentions of this on the MySQL site which seem to point to Mono not supporting the required infrastructure to make transactions work. There's also a comment that transactions work fine when using CommittableTransaction rather than TransactionScope. So I tried that, but got the same exception.
Another comment on the MySQL site suggested rebuilding the MySQL data provider with the MONO build option. Which I tried and the site now works, but transactions aren't being used - they've been simply disabled. Really?
I find it hard to believe that transactions can't be made to work in this environment, but can't find a working example.
Mono 2.6.7, MySQL Connection/NET 6.3.4, Subsonic 3, Ubuntu 10.10

Figured it out. It's TransactionScope that doesn't seem to work. Reverting back to DbConnection.BeginTransaction works fine. I've written up how to do it under Subsonic here: http://www.toptensoftware.com/blog/posts/18/using-transactions-with-mono-mysql-and-subsonic

I also had this problem with mono v.2.10.9 and mysqlconnector v. 6.6.5 and 6.7.2-Beta and I was unable to find a solution for this problem but now I figured it out.
First I took the sources of mysqlconnector and added them into my project folder. Thought it would work if I compile the connector directly with mono but it doesn't.
Then I stepped trough the code and I found that there are the following lines of code at line 530 in the file Connection.cs of the MySql.Data project:
#if !MONO && !CF && !RT
Console.WriteLine("### Should not be here... ###");
if (Transaction.Current != null && Settings.AutoEnlist)
EnlistTransaction(Transaction.Current);
#endif
The Console.WriteLine was added by me to try if it will also appear if I run my Application with mono and it appeared. So I commented this lines out and after that everything was working at this moment.
The real solution however should not be to comment out some lines of code.
For solving this you have to define the 'MONO' symbol.
If you are using MonoDevelop just right click on the project MySql.Data and select the compiler section. There you will find a textbox with the label 'define symbols' or something similar. Simply add the new symbol 'MONO' into this textbox.

Related

Code completion in Toad

I started developing in pl/sql recently. The IDE of choice is Taod. I quickly found out how to do codecompletion for tables, but I can't find a way to get code completion for variables.
I'm used to Textmate on the Mac where I simply write the beginning letters of a string and hit esc. The string is suplemented then with other strings from the same file which have the same beginning.
I was wondering if there is something like it in Taod, but I can't find it anywhere. I checked the checkbox next to Available Variables/Parameteres in Code Assist -> Toad Insight Objects but that didn't help.
Update: Toad Version 12.5.1.1. As pointed out in the first comment I did everything right, but it's actually a bug in this version of Toad.
That checkbox you tried is the way to go about it. There is a bug in Toad 12.5 (maybe earlier versions too) where it's not showing variables if they are defined in lowercase. If they are in uppercase it's OK. This is fixed in Toad 12.6 to be released soon.

MS-Access References When creating VBA macros

I've been trying to develop a system where an ms-access database comunicates with a brother ql-500 label printer to print a label based on data entered to a form, but for some reason, I am using the documentation for b-Pac, the "plugin" from brother created for this interfacing and i get a syntax error in ms-access, which leads me to think there might be some problem with the references. I checked and double checked and uninstalled the plugin and installed the plugin again, up to no solution...
My question here is, is there a way to check the references to see if it is the right file?
Im very new to access programming and this was asked to do in work...
EDIT: Over this one now, it was actually bad syntax, as i was refering to documentation from another version of the bPac plugin, it seems they have changed the syntax in one of the last versions...
Now i have another problem, a runtime error: -2147023782(800705a)
EDIT 2: i solved the problem, i uninstalled through control panel and then deleted remaining files manually and proceeded to install the b pac plugin again and it works now, thank you for your help though guys ;)
I am not sure if this is what you are looking for. I haven't worked with plugins so far.
In VBA window, go to : Tools > References
This should bring up the following window :
Check to see if your plugin is refered in there, or use Browse to locate and add it to the project.
Hope this helps.

Signal command map injection error

I am using Robotlegs to create a simple application in as3, which I have been using for a couple of months now. I seem to be getting an injection error when injecting the ISignalCommandMap into my config file, which has only started happening after I moved my application from one computer to another. It may be to do with conflicting libraries, but I have re-downloaded the newest versions of everything. I am also using starling in the application, but everything was working on the other computer.
Here is the error I am getting
Injector is missing a mapping to handle injection into property "commandMap" of object "[object Config]" with type "Config::Config". Target dependency: "robotlegs.bender.extensions.signalCommandMap.api::ISignalCommandMap|"
Any thoughts to why this has started happening?
What solved this for me was extending MVCSBundle like in this example project and then using that class in place of MVCSBundle.

Installing mym to connect to mysql with matlab

After quite a bit of searching and trying different things, I am stumped on how to get mym to work (as found here: http://sourceforge.net/projects/mym/). I was wondering if anyone has a very simple list of actions needed to get this to work. I think my main trouble is installing zlib. I don't understand how to actually install it or work with it. I have tried to use Microsoft Visual C++ Express 2010 but then only the debug versions are compiled. That means when I try to use the mex function in matlab it gives me the error:
Error: Could not detect a compiler on local system
which can compile the specified input file(s)
I just don't understand the process and everywhere I look it says something different. I have tried multiple versions of each all of the programs involved and nothing seems to work. Any help would be greatly appreciated.
Do:
mex -setup
from the command line to define your compiler on your system. Once you do that then Matlab will correctly locate the compiler and build the mex libraries it needs.
See:
http://www.mathworks.com/help/matlab/matlab_external/building-mex-files.html

Netbeans 6.1 Debugger stopped working with error com.sun.jdi.InternalException: Unexpected JDWP Error: 502

I have been using Netbeans 6.1 for a long time and my debugger has always been flawless. Somehow recently (within the last two weeks or so) my debugger stops at breakpoints but it either freezes most of the time or i can't find out the value of any variable, my local variables wont expand and my watches will sometimes show all nulls even for this.hashCode() or not even update at all and freeze.
When this happens i see the following netbeans exceptions
com.sun.jdi.InternalException: Unexpected JDWP Error: 502
at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47)
at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:379)
at org.netbeans.modules.debugger.jpda.expr.TreeEvaluator.invokeVirtual(TreeEvaluator.java:164)
at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:844)
at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.invokeMethod(AbstractObjectVariable.java:417)
at org.netbeans.modules.debugger.jpda.ui.models.JavaVariablesFilter.getChildren(JavaVariablesFilter.java:133)
at org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter.getChildren(VariablesTreeModelFilter.java:193)
at org.netbeans.spi.viewmodel.Models$CompoundTreeModel.getChildren(Models.java:628)
at org.netbeans.spi.viewmodel.Models$CompoundModel.getChildren(Models.java:2819)
at org.netbeans.modules.viewmodel.TreeModelNode$TreeModelChildren.evaluateLazily(TreeModelNode.java:701)
at org.netbeans.modules.viewmodel.TreeModelNode$LazyEvaluator.run(TreeModelNode.java:1124)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
com.sun.jdi.InternalException: Unexpected JDWP Error: 502
at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47)
at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:379)
at org.netbeans.modules.debugger.jpda.expr.TreeEvaluator.invokeVirtual(TreeEvaluator.java:164)
at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:844)
at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:315)
at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:285)
at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel.getLimitedToString(VariablesNodeModel.java:316)
at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel.getShortDescriptionSynch(VariablesNodeModel.java:275)
at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel$1.run(VariablesNodeModel.java:233)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Does anybody know how to fix or workaround this problem? I have googled this exception but can't find anything of value. The only thing i found is about running two different JVMs, one to debug and one to run the application (but this is not the case for me, both JVMs are the exact same version "1.4.2_03"). I am running into this issue at work so upgrading Java or my IDE is not an option, though it this was fixed in a newer version of the IDE i would still like to know that but most importantly I really need a fix or workaround for this. I have also not changed any settings in my project or NetBeans that i am aware of from the time my debugger was working to now.
Thanks
Append: I also got the following message
A com.sun.jdi.InternalException exception has occurred.
Please report this at http://www.netbeans.org/community/issues.html,
including a copy of your messages.log file as an attachment.
The messages.log file is located in your C:\Documents and Settings\default.netbeans\6.1\var\log folder.
And i have a copy of messages.log if anyone wants me to post it.
I also tried debugging with a different project that i haven't used in a while and it still failed in the same way.
I could really use some help on this one.
It's probably issue # 136461. If the software update(s) for 6.1 do not fix it, then you're probably out of luck. NB 6.1 is over 2 years old at this point.
I understand the desire to keep all developers on the same IDE release. A change to a .form file or a nbproject file can spoil an unwary developer's day.
However, can you install a personal copy of 6.9 and just use it for debugging? Keep the 6.1 around to verify everything before committing.