Prev: "(if-else-)" conditional expression from the waste land
Next: When a conditional expression is static, where can it be used?
From: tonyg on 30 Jun 2010 04:34 I am calling this gnade function in the mysql package to get some debug info Put_Line(To_String(String_Field (TheDatabase, TheHeaterQuery, 1))); it unfortunately hangs though and the task stops I am thinking perhaps the whole task has either hung or terminated without telling me. Would gnat tell me if this task had crashed?
From: Ludovic Brenta on 30 Jun 2010 05:00 tonyg wrote on comp.lang.ada: > I am calling this gnade function in the mysql package to get some > debug info > > Put_Line(To_String(String_Field (TheDatabase, TheHeaterQuery, 1))); > > it unfortunately hangs though and the task stops > > I am thinking perhaps the whole task has either hung or terminated > without telling me. > > Would gnat tell me if this task had crashed? If you actually run the Put_Line in a task (with the Ada keyword "task") then the language rules say that any exceptions will silently cause the task to terminate. You should add an exception handler, log the exception and decide whether or not to terminate the task. You can also run your program in the debugger. -- Ludovic Brenta.
From: tonyg on 30 Jun 2010 05:03 On 30 June, 09:34, tonyg <tonytheg...(a)googlemail.com> wrote: > I am calling this gnade function in the mysql package to get some > debug info > > Put_Line(To_String(String_Field (TheDatabase, TheHeaterQuery, 1))); > > it unfortunately hangs though and the task stops > > I am thinking perhaps the whole task has either hung or terminated > without telling me. > > Would gnat tell me if this task had crashed? I put the code in a straight procedure and I get a constraint error which is raised CONSTRAINT_ERROR : gnu-db-mysql.adb:883 invalid data I am wondering what field types are good to use in a ada mysql database connection and what I am doing wrong here - has anybody any ideas ?
From: Ludovic Brenta on 30 Jun 2010 05:23 tonyg wrote on comp.lang.ada: > On 30 June, 09:34, tonyg <tonytheg...(a)googlemail.com> wrote: >> I am calling this gnade function in the mysql package to get some >> debug info >> >> Put_Line(To_String(String_Field (TheDatabase, TheHeaterQuery, 1))); >> >> it unfortunately hangs though and the task stops >> >> I am thinking perhaps the whole task has either hung or terminated >> without telling me. >> >> Would gnat tell me if this task had crashed? > > I put the code in a straight procedure and I get a constraint error > which is > > raised CONSTRAINT_ERROR : gnu-db-mysql.adb:883 invalid data > > I am wondering what field types are good to use in a ada mysql > database connection and what I am doing wrong here - has anybody any > ideas ? Looking at gnu-db-mysql.adb:883 (for gnade 1.6.1 or 1.6.2) indicates that your variable TheHeaterQuery is not initialized. -- Ludovic Brenta.
From: tonyg on 30 Jun 2010 05:29
On 30 June, 10:23, Ludovic Brenta <ludo...(a)ludovic-brenta.org> wrote: > tonyg wrote on comp.lang.ada: > > > > > > > On 30 June, 09:34, tonyg <tonytheg...(a)googlemail.com> wrote: > >> I am calling this gnade function in the mysql package to get some > >> debug info > > >> Put_Line(To_String(String_Field (TheDatabase, TheHeaterQuery, 1))); > > >> it unfortunately hangs though and the task stops > > >> I am thinking perhaps the whole task has either hung or terminated > >> without telling me. > > >> Would gnat tell me if this task had crashed? > > > I put the code in a straight procedure and I get a constraint error > > which is > > > raised CONSTRAINT_ERROR : gnu-db-mysql.adb:883 invalid data > > > I am wondering what field types are good to use in a ada mysql > > database connection and what I am doing wrong here - has anybody any > > ideas ? > > Looking at gnu-db-mysql.adb:883 (for gnade 1.6.1 or 1.6.2) indicates > that your variable TheHeaterQuery is not initialized. > > -- > Ludovic Brenta. Do you have some example code I can take a look at that retrieves a string from a database? |