Normal Topic AlternateServer command (Read 1216 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
AlternateServer command
May 8th, 2014 at 9:21pm
Print Post Print Post  
We've been experimenting with the AlternateServer command as it seems to be a nice option to split up our larger databases across two servers to maximize memory usage.

Xlookup's work great, but we can't seem to xPost to the alternate server. Is this a limitation of the AlternateServer command? Can we get a list of which commands are available with AlternateServer?

Thanks!

Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: AlternateServer command
Reply #1 - May 9th, 2014 at 4:58pm
Print Post Print Post  
I just checked the code in XPost and it is looking for an alternate server. Do you have a test case where XLookup (or some-such) is certainly working, bu XPost is not?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Will_in_Texas
Member
*
Offline



Posts: 6
Joined: Oct 8th, 2012
Re: AlternateServer command
Reply #2 - May 9th, 2014 at 7:52pm
Print Post Print Post  
Hi Mark,

I'm working with Steve on this issue.  We did get it the xpost command to work, but only when we use the alternateserver command before the xpost, it was needed twice.  I wasn't able to have:
@alternateserver()
@xlookup
xpost



This code does not post until we added a second @alternateserver command

Code
Select All
var vget as string = ""
var qq as int

qq = @alternateserver("server2", 20020, 20021)
vget = @xlookup("./data/import_tools/828.db", one, "one", "two")
xpost("./data/import_tools/828.db", one, "one", "MATCH", "three", "")
writeln(@error)
CloseAlternateServer()

writeln(vget) 

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: AlternateServer command
Reply #3 - May 9th, 2014 at 9:23pm
Print Post Print Post  
Do you need a second "CloseAlternateServer" as well?

Do two @XLookups in a row work -- or is it only XPost?

Any @Error?

Could you post the code that is working?

I'll look into it.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Will_in_Texas
Member
*
Offline



Posts: 6
Joined: Oct 8th, 2012
Re: AlternateServer command
Reply #4 - May 12th, 2014 at 2:25pm
Print Post Print Post  
The Cow wrote on May 9th, 2014 at 9:23pm:
Do you need a second "CloseAlternateServer" as well?

I don't think so.  Doesn't seem to make a difference

The Cow wrote on May 9th, 2014 at 9:23pm:
Do two @XLookups in a row work -- or is it only XPost?

No, only the first X command seems to work

Any @Error?

Could you post the code that is working?

I'll look into it.

This code does NOT work (extra alternateserver commands commented out):
Code
Select All
var vget1 as string = ""
var vget2 as string = ""
var qq as int

qq = @alternateserver("server2", 20020, 20021)
vget1 = @xlookup("./data/import_tools/828.db", one, "one", "two")
//qq = @alternateserver("server2", 20020, 20021)
vget2 = @xlookup("./data/import_tools/828.db", one, "one", "three")
//qq = @alternateserver("server2", 20020, 20021)
xpost("./data/import_tools/828.db", one, "one", "MATCH", "four", "")
writeln(@error)
CloseAlternateServer()

writeln("vget1: "+vget1)
writeln("vget2: "+vget2) 



Produces this in the slate:
yes
vget1: RUN1
vget2:





This code does work:
Code
Select All
var vget1 as string = ""
var vget2 as string = ""
var qq as int

qq = @alternateserver("server2", 20020, 20021)
vget1 = @xlookup("./data/import_tools/828.db", one, "one", "two")
qq = @alternateserver("server2", 20020, 20021)
vget2 = @xlookup("./data/import_tools/828.db", one, "one", "three")
qq = @alternateserver("server2", 20020, 20021)
xpost("./data/import_tools/828.db", one, "one", "MATCH", "four", "")
writeln(@error)
CloseAlternateServer()

writeln("vget1: "+vget1)
writeln("vget2: "+vget2) 



Produces this in the slate:
no
vget1: RUN1
vget2: RUN2

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: AlternateServer command
Reply #5 - May 12th, 2014 at 7:44pm
Print Post Print Post  
I looked into it.

Each command that can use the alternate server (the "X" family) automatically closes the connection after that command completes. This is because you can specify using the alternate server in the filename of the application file:

[server_name]:port1:port2:app_file_name

If it didn't automatically close in this case, it would never revert back to the original server.

I will add a flag in Sesame3 to indicate the the alternate server was specified with the alternate server command instead, and in that case, not automatically close the connect upon command completion.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Will_in_Texas
Member
*
Offline



Posts: 6
Joined: Oct 8th, 2012
Re: AlternateServer command
Reply #6 - May 12th, 2014 at 7:56pm
Print Post Print Post  
Sounds good, thanks for checking it out Mark.
  
Back to top
 
IP Logged