Page 1 of 1
Transaction started from a Delphi package
Posted: Tue 01 Apr 2014 23:24
by wdwhitaker123456789
My main application has a datamodule containing a TSQLConnection component. When I call a package from this application and try to create a transaction (StartTransaction(TD)) I receive an Access Violation. I am able to open a TSQLQuery pointing to that same TSQLConnection, but not start a transaction. Does anyone know the proper procedure so I don't have to create a TSQLConnection inside all packages that I'm calling from the main application?
Re: Transaction started from a Delphi package
Posted: Wed 02 Apr 2014 13:04
by AlexP
Hello,
We cannot reproduce the problem. Please send a small project (both application and package) reproducing the problem to alexp*devart*com
Re: Transaction started from a Delphi package
Posted: Wed 07 May 2014 18:28
by wdwhitaker123456789
I sent sample code last month but have not heard anything back. Did you receive that and if not, what is the best way to get this to you?
Re: Transaction started from a Delphi package
Posted: Wed 21 May 2014 13:49
by azyk
Hello,
We investigated the code sample you have provided - and reproduced the problem:
In the line
the reason for Access Violation is dmDB = nil. Make sure dmDB is initialized before it is used.
Re: Transaction started from a Delphi package
Posted: Wed 21 May 2014 14:11
by wdwhitaker123456789
dmDB is created initially when the main application form is opened. If I have already created dmDB (as part of the opening of the application), how do I pass that to the package? I can't recreate it.
I've been testing and I've noticed that when the package is loaded dynamically, the error occurs. If the package is loaded statically, then no error occurs. I'd prefer to load the package dynamically.
Re: Transaction started from a Delphi package
Posted: Thu 22 May 2014 14:29
by azyk
Hello,
You can pass the link to the object to dynamic library in various ways, for example, via a procedure. This doesn't apply to dbExpress driver for SQL Server, so you can learn more about this from the Embarcadero documentation.
Re: Transaction started from a Delphi package
Posted: Thu 22 May 2014 16:04
by wdwhitaker123456789
That's the problem I have is finding that documentation. What I have found on Embarcadero doesn't seem to answer this specific issue. If you have a link that points to what you are suggesting, it would be appreciated. I have tried many different methods and haven't found the answer to this specific question. Can you post a link or method others have used to deal with this issue?
Re: Transaction started from a Delphi package
Posted: Fri 23 May 2014 14:19
by azyk
Hi,
We have modified your project, namely: passed dmDB via a parameter in the procedure called from bpl in the application.
We have sent a letter with an attachment to your email, including the project with the above corrections.