ADO SQLServer dbGo generates a EAccessViolation - ado

I have a program that is filling a DB in a single thread.
I Use one connection for all queries. Thats so i will be able to run them all in transactions.
Every second I get a new set of files that has to be entered into a SQL Server 2005 Express.
The Application can run for 24 to 36 hours and than suddenly get a "EAccessViolation" in a query.
This query is by then been executed for atleast 24 * 60 * 60 times.
I'm not shure if it also happens with querys without parameres because most of the queries (90%) has parameres. they are inserts/updates or select with a parameter(s).
when this occures all queries afterwards get the same EAccessViolation and after a while I get a StackOverflow.
While the code is constructed in sutch a manner that an exception will be handled and the next time the code should run without problems.
the fact that this is happening in varios queries (that did't change from the former version) with the only change that in stead of using dbGo from BCB Builder 2007 we did ADO with Cpp Builder 6.0.
I asume that it is someware in the Windows version MDAC(2.8) or in de dbGo from CodeGear. The fact that in the previous version (ADO BCB6.0)we did't run into it and now with (dbGO and BCB2007) we have is it making that part very suspicius.
I hope that some has some nice Ideas what could be the reason for all this.
At the moment I Can't reproduce it here on a desktop. I'm still trying to get it reproduced that will defibnitly give more info.
I'm open for suggestions.
regards
jvdn.

I would suspect the driver - try using a different one to see if the problem can be isolated. Also try to rewrite the query to use a different syntax, maybe you could recyle the connections every so often?

Related

Can't connect to SQL Server in Delphi 10.3

I just installed the community version of Delphi, Delphi 10.3
I want to use FireDAC in stead of ADO,
so I want to test connections to SQL Server using FireDac but it is a complete disaster.
I dropped a FDConnection component on the form, and want to configure it to use Sql Server
There I notice I can choose from many DriverNames but not MSSQL
Why is that ?
So I tried the FireDAC Explorer but this has even more mysteries.
I add a new Connection Definition and there I can use MSSQL, but I cannot save this definition.
The save and save as button are disabled.
So I enter all the parameters I need, and yes, it opens my SQL Server database. I can see all tables, views, procedures... And I can even open a table to see the first 10 rows.
Great, if I could only save this definition...
Everytime I open the FireDAC Explorer my new definition is still there, but all parameters are not stored. I have to enter them all every time again.
But, no problem I think. I copy the parameters from the working definition and paste it in the parameters from the FDConnection on my form.
The parameters look like this
User_Name=xx
OSAuthent=No
Server=123.456.789.987\GTT
Database=DB_Test
DriverID=MSSQL
Name=DB_Test
Hm, interesting. Now it does show MSSQL as drivername. So let's set the connection property to true.
Now I get this error (allthough this is working fine in FireDAC Explorer with these parameters)
[FireDAC][Phys]-300. Driver [MSSQL] is not registered. To register it,
you can drop component [TFDPhysMSSQLDriverLink] into your project.
Well alright, if that is all I need to do.
But, it seems I don't have the component TFDPhysMSSQLDriverLink
I have others for all kind of databases, but not this one.
It seems there is something missing, but the errors don't give me much of a clue
So I am hoping there is someone here that understand the errors and can help me to fix this
EDIT
I found this question here with an accepted answer, but I don't know how to use that answer. I have no clue how to use the License manager to register FireDAC

FireDac ApplyUpdates Bug on FDTable with CachedUpdate

I develop and application on Delphi 5 with BDE and never got any reclaim till I update to Delphi XE 10 I change my data Engine From BDE to Firedac. program is simple POS app make invoices , Invoice Table with Items table master-details. from time to time miss some invoices not specific but around 11 each 1000.
I start looking, checking and changing , i add Transaction component.. test same result later adding SchemaAdapter same result Till i figure out what is the problem
if the data Server running an statement in the same time what to run a different statement from another client on the same table here you can found the big bug on FireDac that the 2th client will appear that the data saved but in fact nothing saved
otherwise same scenario on BDE the result completely different the 2th client raise an error with message "Dead ... SQL " at least know that the data not saved
Hope some test that too , heavy SQL statement run it on the Server and try to insert on the table in CachUpdate -> and applyUpdate and will see the result
All Above use Interbase Database
This issue resolved in Delphi 10.3 , the Firedac engine work fine now

FME Server fails some jobs due to not being able to read SDE file but others succeed

looking for some FME help if anyone can. I am having a bit of an issue where I am running a workspace through FME server to turn GML into single line sql using a GEODATABASE_SDE writer. Have a few other workbenches doing same thing for different data sets and they work fine. This particular one however runs 21 jobs in server reading in the different files, 2 succeed and write features to the sql database, 19 fail with
An error occurred while attempting to retrieve the connection
parameters from the connection file
I can't figure out why it would work for 2 (different 2 each time) and not the others. The SDE file works fine in Arc Catalogue to connect to the DB.
I have tried rebuilding the writers to make sure that they were pointing at the right SDE connection and did not have some reference to an old one left.
Has anyone encountered this before or have any ideas on what is causing this? Thanks in advance for any help

Delphi - ISAPI DLL Application hanging on Fastreport

Found this this post ISAPI web application hanging if FastReport.PrepareReport is called
It helped solving my problem partially. As well I´ve turned Wisiyng property to False on frxRichView. Since I'm retunrnig a base 64 string I've also tryed switched loading from StrToStream/LoadFromStream to LoadFromFile. The problem persist with multiple acess, 2 out of 10 process can finish loading my Pdf file. All the others requests hangs until timeout. Does anyone have an idea what else can I do? is there anyother way to retunr rtf format into Fastreport report Thanks.
I could only get time-out error using Selenium to test multiples request from the client side.
Update: I've figured that just having a TfrxRichView component in the report causes the hanging, it doesn't even need to have a rtf text on it. Replacing it to a memo all request are answered.
UPDATE: Got a answer from fast report and I wold like your opinion.
ok,
I had similar problems, and it is not easy to find out the reason, but maybe you can find your solution in between my considerations..
1) Stack Size
When ran in IIS your ISAPI is only a DLL called by a process, you are not the main process so you have to pay attention to stack dimension.
Normally a Delphi application have a default stack size of 1Mb, in ISAPI DLL you will have only 256Kb of stack.
Maybe you are facing a stack overflow exception.. it can explain why it does not occurr always but only in some circumstances..
2) Trapped Exception
In general you get some error during the preparation of report (aka all the job of working with data, expressions, variables, formulas etc etc..) can bring to a trapped exception. You may be unable to see it from outside but code execution was broken somwhere and report preparation had not finished.
3) MessageBoxes and/or standard Exceptions
when running in ISAPI you should not output anything to user interface,
maybe a message dialog (or an exception) can bring to unexpected behaviour.
4) Global Var
You should avoid global var because in ISAPI they will be common across threads
So, if you have sources, debug the application.. at first exception you should understand where is your problem..
If you have not sources.. chek the above list.. I hope you can find some useful information.
You have two ways to solve this:
1- Try to recreate this behavior while debugging your ISAPI DLL. If you are lucky, you can identify the thread that is hanging your application. Sometimes this is hard or even impossible to recreate.
2- If you have access to the hung ISAPI application instance, use a tool like SysInternals Process Explorer to create a minidump file. Your application must be built using full debug symbols and you should have the corresponding map file. With one (or more - even better) dump files obtained from your hung application plus the map file, you can use another tool, WinDbg to analyze it and find the cause. (Sometimes) WinDbg can show exactly which thread is hanging the whole application and the line of code that causes it.
If you have never done that, I must warn you that this kind of analysis is almost a gamble... You have to use several different tools with little
or no documentation, read heaps of technical info in various places. In the end, sometimes it works wonderfully and sometimes it fails miserably.
Because debugging ISAPI is not obvious, but also because I wanted to be able to switch easily between more different hosting solutions — and wanted to update my website on the fly without a restart of the web-server/service — I created xxm. It has a singular interface to the HTTP context, your DLL gets loaded by either a IIS ISAPI handler, or a HTTP.SYS handler, or an Apache httpd module, or for debugging locally you can just set xxmHttp.exe as host application to get IIS out of the way.

Connecting to local server via dBExpress

My D7 dBExpress project is supposed to connect to a local Interbase XE7 server.
It has the usual DBX setup: SqlConnection, SqlQuery, DataSetProvider and
ClientDataSet and does a simple 'select * from mytable'.
Last time I used it, it was working fine, but today when I ran it inside the IDE,
I get an exception as I call
ClientDataSet1.Open;
in my FormCreate (that call is the entire code of the project, btw). The
exception is an EDatabaseError with msg "No mapping for Error Code Found." and happens in TSqlConnection.DoConnect
That sounds familiar - I got that error myself one time, when I went back to an IB project after a few weeks.
It turned out that in the meantime something had sneaked Firebird onto my machine and it had hijacked the port IB usually listens on, and it was actually this FB server which was rejecting the connection, not the Interbase one!
Take a look under Services to see whether there is an FB server running. If there are, close it down (and start the IB server if not already running, of course). Then try your DBX project again.
Somewhere in the IB docs, I found something which seemed to suggest there was a way of getting FB and IB servers to coexist, but to avoid falling into a similar trap another time, I wrote a couple of batch files to shut down one of them and start the other. One is called "UseIB" and contains:
net stop "Firebird server - DefaultInstance"
net start "InterBase XE7 Server gds_db"
The other one, "UseFB" just does the opposite, of course.

Resources