Transaction started from a Delphi package
-
- Posts: 5
- Joined: Tue 01 Apr 2014 23:19
Transaction started from a Delphi package
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
Hello,
We cannot reproduce the problem. Please send a small project (both application and package) reproducing the problem to alexp*devart*com
We cannot reproduce the problem. Please send a small project (both application and package) reproducing the problem to alexp*devart*com
-
- Posts: 5
- Joined: Tue 01 Apr 2014 23:19
Re: Transaction started from a Delphi package
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
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.
We investigated the code sample you have provided - and reproduced the problem:
In the line
Code: Select all
dmDB.sqlDB.starttransaction(TD);
-
- Posts: 5
- Joined: Tue 01 Apr 2014 23:19
Re: Transaction started from a Delphi package
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.
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
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.
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.
-
- Posts: 5
- Joined: Tue 01 Apr 2014 23:19
Re: Transaction started from a Delphi package
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
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.
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.