Database availability

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Database availability

Trevor Jacques
I have been trying to find out how to test if a database, not a
database connector, is available.

I've checked the ldml reference for 'database' and it only pointed to
DatabaseConnectionUnavailable. I searched the reference manual pdf
for DatabaseConnectionUnavailable, but there's nothing at all in the
pdf.  :-/

Neither could I find anything in the list archive about how to test
for a database not being available (as opposed to the database
connexion not being available, which I take to be an assessment of
the Lasso database connector availability).

Can anyone tell me how to determine if a specific database is
currently available to Lasso (something like pinging the database
itself, rather than the database server or the database connector)?
Thanks.

T.

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

James Harvard
At 8:45 am -0400 26/5/05, Trevor Jacques wrote:
>I have been trying to find out how to test if a database, not a database connector, is available.

If it's an SQL database I would try something like running a 'show tables' statement.
HTH,
James Harvard

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

Jeremy Schwartz
In reply to this post by Trevor Jacques
If you try and perform an inline on a db and it doesn't exist, Lasso  
will return a database not found error.
---
Jeremy Schwartz
OmniPilot Software
VP, Product Management
[hidden email]
954-874-3110


On May 26, 2005, at 8:45 AM, Trevor Jacques wrote:


> I have been trying to find out how to test if a database, not a  
> database connector, is available.
>
> I've checked the ldml reference for 'database' and it only pointed  
> to DatabaseConnectionUnavailable. I searched the reference manual  
> pdf for DatabaseConnectionUnavailable, but there's nothing at all  
> in the pdf.  :-/
>
> Neither could I find anything in the list archive about how to test  
> for a database not being available (as opposed to the database  
> connexion not being available, which I take to be an assessment of  
> the Lasso database connector availability).
>
> Can anyone tell me how to determine if a specific database is  
> currently available to Lasso (something like pinging the database  
> itself, rather than the database server or the database connector)?  
> Thanks.
>
> T.
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  http://www.listsearch.com/ 
> lassotalk.lasso?manage
>
>



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

Trevor Jacques
In reply to this post by Trevor Jacques
>Jeremy wrote: If you try and perform an inline on a db and it
>doesn't exist, Lasso will return a database not found error.

Ah, the dreaded -609. Good idea. Thanks.

This does, however, beg the question: is there a way to determine the
difference between a database set up existing in Lasso but the
database is down/unavailable, and the database not being defined in
Lasso?

T.

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

Eric Landmann
In reply to this post by Trevor Jacques
James Harvard <[hidden email]> wrote on Thursday, May 26, 2005:

>At 8:45 am -0400 26/5/05, Trevor Jacques wrote:
>>I have been trying to find out how to test if a database, not a database connector, is available.
>
>If it's an SQL database I would try something like running a 'show tables' statement.

We do a simple test with Whistleblower hitting a web page that does a simple Lasso database lookup. The test looks for a known value in the database in a field that is created specifically for this purpose. Using this method tests the whole round-trip from browsser through the webserver, middleware and database, assuring everything in the chain is working properly.

--Eric

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

Jeremy Hahn
In reply to this post by Trevor Jacques
You could also do something like ...


Protect;


   Inline( -username='test', -password='***', -database='blah', -sql=$Query
);


            If( error_currentError != 'no error' );

                // Handle this error.
            /if;

   /inline;

Handle( error_code( '-609' );


         // Routine to handle the database not found error.
/Handle;

/protect;


HTH,
------------------------------------------
Jeremy Hahn
OmniPilot Software
Product Specialist
[hidden email]
Tel: 954-874-3151
Toll Free: 800-678-9958 x151
 
 

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Eric Landmann
> Sent: Thursday, May 26, 2005 9:36 AM
> To: [hidden email]
> Subject: Re: Database availability
>
> James Harvard <[hidden email]> wrote on Thursday,
> May 26, 2005:
>
> >At 8:45 am -0400 26/5/05, Trevor Jacques wrote:
> >>I have been trying to find out how to test if a database, not a database
> connector, is available.
> >
> >If it's an SQL database I would try something like running a 'show
> tables' statement.
>
> We do a simple test with Whistleblower hitting a web page that does a
> simple Lasso database lookup. The test looks for a known value in the
> database in a field that is created specifically for this purpose. Using
> this method tests the whole round-trip from browsser through the
> webserver, middleware and database, assuring everything in the chain is
> working properly.
>
> --Eric
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

Trevor Jacques
In reply to this post by Trevor Jacques
>Jeremy wrote: You could also do something like ...

Thanks. I think that's the best solution.

T.

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

Greg Willits
In reply to this post by Trevor Jacques
On May 26, 2005, at 10:32 AM, Trevor Jacques wrote:

>> Jeremy wrote: You could also do something like ...
>
> Thanks. I think that's the best solution.

This bends the thread towards "Error Handling...", but here goes:

If I may be so bold... every query should be testing for returned
errors anyway so that such a condition is caught, handled gracefully,
and reported. Weak error handling is a sure sign of an app prone to
break in ways you really don't want it to which is not only a
reliability problem, but a potential security problem too.

There are a multitude of possible failures, and each may require a
different handling response, so writing that out for each query is not
only a bore, it is prone to problems -- leaving certain cases out,
typos, etc. Error handling is good reason to centralize a query
processor in a ctag or ctype, so you don't have to write out the error
handling over & over for every query.

-- greg willits


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

Trevor Jacques
In reply to this post by Trevor Jacques
>Greg wrote: This bends the thread towards "Error Handling...", but here goes:

I agree.  :-)

T.

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

James Harvard
In reply to this post by Trevor Jacques
At 11:32 am -0700 26/5/05, Greg Willits wrote:
>There are a multitude of possible failures, and each may require a different handling response, so writing that out for each query is not only a bore, it is prone to problems -- leaving certain cases out, typos, etc. Error handling is good reason to centralize a query processor in a ctag or ctype, so you don't have to write out the error handling over & over for every query.

A reason _not_ to cetralize query processing in a ctag / ctype is that Lasso doesn't seem to be able to reuse the db connection for queries in ctags.

I've not got around to asking OP whether this is simply not possible for some technical reason or other.

James

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: Database availability

Bil Corry
In reply to this post by Trevor Jacques
> Lasso doesn't seem to be able to reuse the db connection for queries in ctags.

My bet is Lasso can if you use the JDBC connector instead of the MySQL
connector, since the JDBC connector takes care of the connection pooling.


- Bil

------

Bil Corry
[hidden email]

Enterprise internet application development and security consulting
  http://www.fivegeeks.com/

Tools for Rapid Lasso Development
  http://www.lassoware.com/
 
-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of
James Harvard
Sent: Thursday, May 26, 2005 12:25 PM
To: [hidden email]
Subject: Re: Database availability

At 11:32 am -0700 26/5/05, Greg Willits wrote:
>There are a multitude of possible failures, and each may require a different
handling response, so writing that out for each query is not only a bore, it is
prone to problems -- leaving certain cases out, typos, etc. Error handling is
good reason to centralize a query processor in a ctag or ctype, so you don't
have to write out the error handling over & over for every query.

A reason _not_ to cetralize query processing in a ctag / ctype is that Lasso
doesn't seem to be able to reuse the db connection for queries in ctags.

I've not got around to asking OP whether this is simply not possible for some
technical reason or other.

James



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage