Autor Beitrag
Delphi_Rainer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 20.12.07 12:37 
Hallo,

Ich arbeite mit Firebird 2.0 und mit TIBEVENT.

Die IBEVENT Komponente arbeitet local prima.

Meine Datenbankanbindung läuft in einem Thread damit bei remote Zugriffe die Anwendung nicht hängen bleibt.

Im Thread wird folgendes (alle 2 Sekunden ) ausgeführt.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
if database1.Connected then
 begin
  if IBEvents2.Registered then
   IBEvents2.Registered:=false;
 end;
 if database1.Connected then
   database1.close;
 if database1.Connected=false then
   database1.Open;
 if IBEvents2.Registered=false then
   IBEvents2.Registered:=true;


Dieses läuft für ca 1 Minute und dann stürzt meine Anwendung ab !!!

Kann mir jemand helfen warum ??

Mache ich das gleiche im Hauptthread (Anwendung) passiert das gleiche.

Moderiert von user profile iconjasocul: Delphi-Tags hinzugefügt
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Do 20.12.07 12:44 
Erstmal: Delphi-Tags!

----

//EDIT: @jaoscul: Sorry!
<-- Delphi-Codes in Tags geändert :roll: -->

_________________
Die Lösung ist nicht siebzehn.


Zuletzt bearbeitet von Mitmischer 1703 am Do 20.12.07 13:31, insgesamt 1-mal bearbeitet
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 20.12.07 12:54 
user profile iconMitmischer 1703 hat folgendes geschrieben:
Erstmal: Delphi-Codes!
Das heißt Delphi-Tags! :mahn:
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 20.12.07 13:09 
Ich habe doch den Sourcecode mitgeteilt !
DelphiMarkus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 303

OpenSuSE
Delphi 2009 Pro., Lazarus
BeitragVerfasst: Do 20.12.07 13:15 
Nein, sie meinten das Syntax-Highlighting, dann ist der Code besser im Browser zu lesen.
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 20.12.07 13:24 
Sourcecode:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
<span style="color: red">if database1.Connected then  
 begin  
  if IBEvents2.Registered then  
   IBEvents2.Registered:=false;  
 end;  
 if database1.Connected then  
   database1.close;  
 if database1.Connected=false then  
   database1.Open;  
 if IBEvents2.Registered=false then  
   IBEvents2.Registered:=true;</span><span style="color: green"></span>


Meinst du so !

Moderiert von user profile iconjasocul: Highlight- durch Delphi-Tags ersetzt
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Do 20.12.07 13:26 
Nein, so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
if database1.Connected then  
 begin  
  if IBEvents2.Registered then  
   IBEvents2.Registered:=false;  
 end;  
 if database1.Connected then  
   database1.close;  
 if database1.Connected=false then  
   database1.Open;  
 if IBEvents2.Registered=false then  
   IBEvents2.Registered:=true;


Mit [delphi]-Tags. Schluss-Tag nicht vergessen!

_________________
Die Lösung ist nicht siebzehn.


Zuletzt bearbeitet von Mitmischer 1703 am Do 20.12.07 13:32, insgesamt 2-mal bearbeitet
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Do 20.12.07 13:30 
Probier doch mal dein Programm in Schritten auszuführen (F7 glaub' ich).
Dann stürzt das Programm irgendwann ja ab - Die letzte Anweisung ist schuld!
Stürzt das Programm einfach so ab, oder mit Fehlermeldung?
Dann könnte ich mir eine Exception vom Typ EAcessViolation (bestimmt falsch geschrieben... :cry: ) vorstellen...

_________________
Die Lösung ist nicht siebzehn.
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 20.12.07 13:35 
Das Programm stürzt mit einer Eaccessviolation in GDS32.dll ab !
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Do 20.12.07 13:39 
Ich hasse EAccessViolations!!!

Immer wenn ich eine hatte, hab' icb sie nie wegbekommen :cry: ...

Eine AccessViolation ist irgendsoetwas wie ein Arbeitsspeicherüberlauf:

Du musst dein Programm bremsen!

ausblenden Delphi-Quelltext
1:
Application.ProcessMessages;					


:nixweiss:
//Edit: Mist! search und delphi-Tags lassen sich nicht kombinieren... :cry:

_________________
Die Lösung ist nicht siebzehn.
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 20.12.07 13:53 
Ich habe es mir nochmal genauer angesehen. Es ist folgende Zugriffsverletzung bei 0x10024413 : Lesen von Adresse 0x0000001C

Sagt das jemand was ?
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Do 20.12.07 13:57 
Was ist der Adresse 0x0000001C zugeordnet?

Lass das Programm mal unter dem Debugger laufen und achte auf das CPU-Fenster (zumindest unter CBuilder 6...)

:|

_________________
Die Lösung ist nicht siebzehn.
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 20.12.07 14:06 
Ich habe das Programm unter AQime5 laufen gelasen und habe folgenge
EAccessviolation bekommen : in adresse 0x0000001C ist die GDS32.dll.

Es trat ein Fehler im Thread auf : SetthreadExecutionstatoe +0227 in GDS32.DLL
Mitmischer 1703
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 754
Erhaltene Danke: 19

Win 7, Debian
Delphi Prism, Delphi 7, RAD Studio 2009 Academic, C#, C++, Java, HTML, PHP
BeitragVerfasst: Do 20.12.07 14:08 
:nixweiss:

Kann mal jemand helfen?

_________________
Die Lösung ist nicht siebzehn.
Delphi_Rainer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Do 20.12.07 14:45 
Sorry !

War gerade Mittag Essen.

Kann mir jemand mit meinem Problem helfen !
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Do 20.12.07 20:57 
GDS32.dll ist eien DLL von Firebird, da wirst du nicht viel machen können (es sei denn, du möchtest Firebird selber debuggen :D ).
Versuchs mal mit einer anderen / aktuelleren Firebird Version (2.0.3 oder 1.5.5).

Alternativ solltest du auch einfach mal deinen quellcode überprüfen..
ausblenden Delphi-Quelltext
1:
2:
3:
4:
 if database1.Connected then
   database1.close;
 if database1.Connected=false then
   database1.Open;

Was wird das?
- Wenn Datenbank geöffnet, dann schließen
- Wenn Datenbank nicht verbunden (nach vorheriger Zeile also IMMER), dann neu verbinden.
Und das alle 2 Sekunden?! Da ist doch klar, dass der dir das irgendwann übel nimmt :D