Recital

Login Register

When stress testing our loadbalancer, i was unable to get more than 20 reliable ssh connections. The following error would be reported.

ssh_exchange_identification: Connection closed by remote host

The resolution for this is quite simple.

Edit the /etc/ssh/sshd_config file and increase the MaxStartups. On my server i set this to 200.

Edit /etc/sysctrl.conf and add the following line:

net.core.netdev_max_backlog = 3000

Then apply this change:

# sysctl -p

 

Published in Blogs
Read more...
Recital 10 introduced the PIPETOSTR() function. This function operates in a similar fashion to the FILETOSTR() function but it can be used to capture the output from externally executed operating system commands. e.g.
// determine how many Recital users are on the system
nusers = pipetostr("ps -ef | grep db.exe | wc -l")
Published in Blogs
Read more...

There's a nice article on IBM developerworks describing how to package software using RPM. You can read it here.

Published in Blogs
Read more...


I am pleased to finally report that the Centos release of Redhats 5.3 has been built and is available for download from http://www.centos.org/

The highlights of this release can be found at the following URL: http://www.redhat.com

The main areas of interest in my opinion excluding critical secirty fixes are:

  • Updated hardwaresupport support for the new Intel Core i7 (Nehalem) chips
  • Beefed up virtualiseation support increasing CPU and Ram limits of Virtual machines.
  • Inclusion of the fully open sourced OpenJDK. This makes Red Hat Enterprise Linux 5.3 the first enterprise-ready solution with a fully open source Java stack when combined with JBoss Enterprise Application Platform.


For those who already have Centos 5.2 installed you can simply receive the update via Yum.

Before you do the following, check that  you do not have 3rd party repo's and the Centos-testing repo enabled.

You can display the currently enabled repo's using the following command.

$ yum repolist



Then as root at the prompt type:

$ yum update

 

Published in Blogs
Read more...

If you have software packages which you wish to share with others or simply between your own personal machines, a neat and easy solution is to create your own YUM repository and provide your .repo file for download.

YUM is by far the easiest method of installing software on Red hat, Centos and Fedora. Not only does it mean you don't need to trawl the web looking for somewhere to download the packages, YUM does a great job of satisfying any package dependencies. As long as the required packages are available in the enabled repositories on your system, YUM will go out and get everything you need.

To create your own YUM repository, you will need to install the yum-utils and createrepo packages:

yum install yum-utils createrepo

yum-utils contains the tools you will need to manage your soon to be created repository, and createrepo is used to create the xml based rpm metadata you will require for your repository.

Once you have installed these required tools, create a directory in your chosen web server's document root e.g:

mkdir -p /var/www/html/repo/recital/updates

Copy the rpm's you wish to host into this newly created directory.

The next step is to create the xml based rpm metadata. To create this use the createrepo program we installed earlier.

At the shell type the following command:

createrepo -v -s md5 /var/www/html/repo/recital/updates


This will create the required metadata in the repodata directory of your /var/www/html/repo/recital/updates directory.

root@test repodata]# ls -l
rwotal 44
-rw-r--r-- 1 root root 28996 Jan 13 21:42 filelists.xml.gz
-rw-r--r-- 1 root root   284 Jan 13 21:42 other.xml.gz
-rw-r--r-- 1 root root  1082 Jan 13 21:42 primary.xml.gz
-rw-r--r-- 1 root root   951 Jan 13 21:42 repomd.xml

To do a final consistency check on your repository run the following command:

verifytree /var/www/html/repo/recital/updates

We now have a fully functioning YUM repository for our hosted rpm packages.
The next process is to create a .repo file in the client systems /etc/yum.repos.d directory.

Navigate to the /etc/yum.repos.d directory on your system as root.

Using your preferred text editor to create the .repo file. In this example I will call it recital.repo.
Now paste in the following lines:

[Recital]
name=Recital Update Server
baseurl=http://ftp.recitalsoftware.com/repo/recital/updates
enabled=1
gpgcheck=1

Once that is saved, at the shell prompt on the same machine (YUM client system).

$ yum repolist
Loaded plugins: presto, refresh-packagekit
repo id                  repo name                                 status
Recital                  Recital Update Server                     enabled:      1
adobe-linux-i386         Adobe Systems Incorporated                enabled:     17
fedora                   Fedora 12 - i386                          enabled: 15,366

As you can see the Recital repo is now being picked up and we have access to all the packages it is hosting.

See how easy that was!

Published in Blogs
Read more...

MQCURMSGS()

Syntax

MQCURMSGS( <expN> )

Description

The MQCURMSGS() function returns the current number of unread messages in the queue specified by <expN>

Example

mqdes=mqopen("/myqueue")
if (mqdes < 0)
   messagebox(strerror()+",errno="+alltrim(str(error())))
   return
endif
do while (mqcurmsgs(mqdes) > 0)
   mstr=mqreceive(mqdes)
   if (empty(mstr))
      messagebox(strerror()+",errno="+alltrim(str(error())))
      return
   endif
   messagebox(mstr)
end do
mqclose(mqdes)

Published in Blogs
Read more...

Latest Development News

The Lianja Application Platform is a cost-effective cloud database computing platform for SMEs (Small and Medium-sized Enterprises) that lets them focus on developing and deploying business Apps without the need to invest in lengthy application development times and an expensive IT infrastructure.

The three pillars of Lianja are:
  • The Lianja App Builder
  • The Lianja Cloud Database
  • Lianja.com Apps
If you need to develop and deploy cross-platform Visual FoxPRO GUI, Web or Mobile Apps visit the Lianja website for further details.

Published in Blogs
Read more...
When using Recital on linux you can integrate your favorite linux shell commands and use then directly inside Recital using the alias command. This can be particularly useful when you ssh into a remote system and run recital. You can then issue linux commands without having to open another terminal session. Several aliased shell commands are predefined in /opt/recital/conf/config.db. You can add others to suit your needs.
 
On my system i have these commands aliased.
alias pwd  "? default()"
alias cp   "copy file "
alias mv   "rename "
alias rm   "erase "
alias ls   "run('ls $0')"
alias ps   "run('ps $0')"
alias grep "run('grep $0')"
alias cd   "set default to $1"
alias cls  "clear screen"
These commands can now be used inside the Recital command window just as you would use them at the linux prompt, including the ability to pipe commands together.
ls -l | grep .prg
ps -elf | grep db.exe
The run() function that is used to run the shell command as specified in the alias command will capture output and display it in a text viewer. If you want to run the command and display the contents full screen, then specify true as the third parameter to the run().
run("command", true, true) 
The arguments to run() are as follows.
Argument Description
1 the command line to run
2 True if output should be displayed in a text area (default True)
3 True if the output should be displayed full screen (default False)
 
The alias command handles parameter substitition.
Macro Description
$0 the command line following the command name
$1..$n the arguments given to the command
Published in Blogs
Read more...

All temporary files created by Recital are stored in the directory specified by the environment variable DB_TMPDIR.

 
In order to have these files stored in memory first create a temporary directory
mkdir /opt/recital/tmp
 
Then mount the directory with the tmpfs command
mount -t tmpfs -o size=1g recitaltmpfs /usr/recital/tmp
 
Then change the DB_TMPDIR variable in the recital.conf to point to the newly created temporary directory.
Published in Blogs
Read more...

In this article Barry Mavin, CEO and Chief Software Architect for Recital, details Working with Stored Procedures in the Recital Database Server.

Overview

Stored procedures and user-defined functions are collections of SQL statements and optional control-of-flow statements written in the Recital 4GL (compatible with VFP) stored under a name and saved in a Database. Both stored procedures and user-defined functions are just-in-time compiled by the Recital database engine. Using the Database Administrator in Recital Enterprise Studio, you can easily create, view, modify, and test Stored Procedures, Triggers, and user-defined functions

Creating and Editing Stored Procedures

To create a new Stored Procedure,  right-click the Procedures node in the Databases tree of the Project Explorer and choose Create. To modify an existing stored procedure select the Stored Procedure in the Databases Tree in the Project Explorer by double-clicking on it or selecting Modify from the context menu . By convertion we recommend that you name your Stored Procedures beginning with "sp_xxx_", user-defined functions with "f_xxx_", and Triggers with "dt_xxx_", where xxx is the name of the table that they are associated with.

Testing the Procedure

To test run the Stored Procedure, select the Stored Procedure in the Databases Tree in the Project Explorer by double-clicking on it. Once the Database Administrator is displayed, click the Run button to run the procedure.

Getting return values

Example Stored Procedure called "sp_myproc":
parameter arg1, arg2
return arg1 + arg2
Example calling the Stored Procedure from C# .NET:
////////////////////////////////////////////////////////////////////////
// include the references below
using System.Data;
using Recital.Data;

////////////////////////////////////////////////////////////////////////
// sample code to call a Stored Procedure that adds to numeric values together
public int CallStoredProcedure()
{
	RecitalConnection conn = new 
		RecitalConnection("Data Source=localhost;Database=southwind;uid=?;pwd=?");
	RecitalCommand cmd = new RecitalCommand();
	cmd.Connection = conn;
	cmd.CommandText = "sp_myproc(@arg1, @arg2)";
	cmd.CommandType = CommandType.StoredProcedure;
	cmd.Parameters["@arg1"].Value = 10;
	cmd.Parameters["@arg2"].Value = 20;
	conn.Open();
	cmd.ExecuteNonQuery();
	int result = (int)(cmd.Parameters["retvalue"].Value);    // get the return value from the sp
	conn.Close();
	return result;
	}

Writing Stored Procedures that return a Resultset

If you want to write a Stored Procedure that returns a ResultSet, you use the SETRESULTSET() function of the 4GL. Using the Universal .NET Data Provider, you can then execute the 4GL Stored Procedure and return the ResultSet to the client application for processing. ResultSets that are returned from Stored Procedures are read-only.

Example Stored Procedure called "sp_myproc":
parameter query
select * from customers &query into cursor "mydata"
return setresultset("mydata")
Example calling the Stored Procedure from C# .NET:
////////////////////////////////////////////////////////////////////////
// include the references below
using System.Data;
using Recital.Data;

////////////////////////////////////////////////////////////////////////
// sample code to call a stored procedure that returns a ResultSet
public void CallStoredProcedure()
{
	RecitalConnection conn = new 
		RecitalConnection("Data Source=localhost;Database=southwind;uid=?;pwd=?");
	RecitalCommand cmd = new RecitalCommand();
	cmd.Connection = conn;
	cmd.CommandText = "sp_myproc(@query)";
	cmd.CommandType = CommandType.StoredProcedure;
	cmd.Parameters["@query"].Value = "where not deleted()";
	conn.Open();
	RecitalDataReader dreader = cmd.ExecuteReader();
	int sqlcnt = (int)(cmd.Parameters["sqlcnt"].Value);    // returns number of affected rows
	while (dreader.Read())
	{
		// read and process the data
	}
	dreader.Close();
	conn.Close();
}
Published in Blogs
Read more...

Copyright © 2025 Recital Software Inc.

Login

Register

User Registration
or Cancel