Working disconnected

View: New views
5 Messages — Rating Filter:   Alert me  

Working disconnected

by César Piñera García :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Is it posible to work disconnected from a database?

 

i want to do something like...

 

database mydata

main

...

   disconect

   call myfunction(params)

   database mydata #to connect again

...

end main

 

This is because myfunction is inside another .4gl file, so it uses another connection in the database.

 

Thank you for your support.

 

 

 

Ing. César Piñera García

GAFI Ferreléctrico S.A. de C.V.

Tel 747-4600 ext 103

 

 


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Aubit4gl-discuss mailing list
Aubit4gl-discuss@...
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

Re: Working disconnected

by Mike Aubury :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You should be able to just 'close database' ...

*** BUT *** from what you've said - you dont need to...
That function will use the same connection as the 'main' - unless its running
a different program/executable (via the 4GL 'RUN' command).

The fact its in a different .4gl doesn't make any difference - so long and
those 4gls are linked into a single executable...



On Wednesday 30 April 2008 19:06:30 César Piñera García wrote:

> Is it posible to work disconnected from a database?
>
>
>
> i want to do something like...
>
>
>
> database mydata
>
> main
>
> ...
>
>    disconect
>
>    call myfunction(params)
>
>    database mydata #to connect again
>
> ...
>
> end main
>
>
>
> This is because myfunction is inside another .4gl file, so it uses another
> connection in the database.
>
>
>
> Thank you for your support.
>
>
>
>
>
>
>
> Ing. César Piñera García
>
> GAFI Ferreléctrico S.A. de C.V.
>
> Tel 747-4600 ext 103



--
Mike Aubury

Aubit Computing Ltd is registered in England and Wales, Number: 3112827
Registered Address : Clayton House,59 Piccadilly,Manchester,M1 2AQ



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Aubit4gl-discuss mailing list
Aubit4gl-discuss@...
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

Re: Working disconnected

by Fernando Ortiz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hola Cesar,

You can only be connected to one database at the time, so you must
connect to the 'correct' database everytime you change connection.

So you can connect to another database before calling myfunction() or
change database inside myfunction()

Note: database statement outside and main/end main, function/end
function is declartive for compilation only, so if you need to run
myfunction() always with anothe database you should put it twice

<code>
database otherdb  # used at compile time for like's
function myfunction()
define ...
database otherdb  # change connection at run-time
....
return
end function
</code>

Note2 : Aubit has the session extension so you can have 2 connections
active to different databases at the same time, does it help to you?

Saludos

César Piñera García escribió:

>
> Is it posible to work disconnected from a database?
>
>  
>
> i want to do something like...
>
>  
>
> database mydata
>
> main
>
> ...
>
>    disconect
>
>    call myfunction(params)
>
>    database mydata #to connect again
>
> ...
>
> end main
>
>  
>
> This is because myfunction is inside another .4gl file, so it uses
> another connection in the database.
>
>  
>
> Thank you for your support.
>
>  
>
>  
>
>  
>
> Ing. César Piñera García
>
> GAFI Ferreléctrico S.A. de C.V.
>
> Tel 747-4600 ext 103
>
>  
>
>  
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aubit4gl-discuss mailing list
> Aubit4gl-discuss@...
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>  


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Aubit4gl-discuss mailing list
Aubit4gl-discuss@...
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

Re: Working disconnected

by César Piñera García :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

  It's as Mike said, i run another executable using the run command, the
main program is a menu who executes all the avaliable options by running
another exes.

But i'd like to disconnect the database from the main program while the
other exe is running and reconnect when it returns, so i can free that
connection and use less resources from the server because right now every
user needs two connections.

Thanks, best regards,


Ing. César Piñera García
GAFI Ferreléctrico S.A. de C.V.
Tel 747-4600 ext 103


-----Mensaje original-----
De: Fernando Ortiz [mailto:fernando.ortiz@...]
Enviado el: miércoles, 30 de abril de 2008 01:29 p.m.
Para: aubit4gl-discuss@...
Asunto: Re: [Aubit4gl-discuss] Working disconnected

Hola Cesar,

You can only be connected to one database at the time, so you must
connect to the 'correct' database everytime you change connection.

So you can connect to another database before calling myfunction() or
change database inside myfunction()

Note: database statement outside and main/end main, function/end
function is declartive for compilation only, so if you need to run
myfunction() always with anothe database you should put it twice

<code>
database otherdb  # used at compile time for like's
function myfunction()
define ...
database otherdb  # change connection at run-time
....
return
end function
</code>

Note2 : Aubit has the session extension so you can have 2 connections
active to different databases at the same time, does it help to you?

Saludos

César Piñera García escribió:

>
> Is it posible to work disconnected from a database?
>
>  
>
> i want to do something like...
>
>  
>
> database mydata
>
> main
>
> ...
>
>    disconect
>
>    call myfunction(params)
>
>    database mydata #to connect again
>
> ...
>
> end main
>
>  
>
> This is because myfunction is inside another .4gl file, so it uses
> another connection in the database.
>
>  
>
> Thank you for your support.
>
>  
>
>  
>
>  
>
> Ing. César Piñera García
>
> GAFI Ferreléctrico S.A. de C.V.
>
> Tel 747-4600 ext 103
>
>  
>
>  
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
>
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao
ne
> ------------------------------------------------------------------------
>
> _______________________________________________
> Aubit4gl-discuss mailing list
> Aubit4gl-discuss@...
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>  


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javao
ne
_______________________________________________
Aubit4gl-discuss mailing list
Aubit4gl-discuss@...
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Aubit4gl-discuss mailing list
Aubit4gl-discuss@...
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss

Re: Working disconnected

by Mike Aubury :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Then 'close database' should do the job...
:-)

On Wednesday 30 April 2008 22:29:06 César Piñera García wrote:

> Hello,
>
>   It's as Mike said, i run another executable using the run command, the
> main program is a menu who executes all the avaliable options by running
> another exes.
>
> But i'd like to disconnect the database from the main program while the
> other exe is running and reconnect when it returns, so i can free that
> connection and use less resources from the server because right now every
> user needs two connections.
>
> Thanks, best regards,
>
>
> Ing. César Piñera García
> GAFI Ferreléctrico S.A. de C.V.
> Tel 747-4600 ext 103
>

--
Mike Aubury

Aubit Computing Ltd is registered in England and Wales, Number: 3112827
Registered Address : Clayton House,59 Piccadilly,Manchester,M1 2AQ



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Aubit4gl-discuss mailing list
Aubit4gl-discuss@...
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
LightInTheBox - Buy quality products at wholesale price!