ZeosLib with MYSQL's shared memory protocol? - mysql

I started up my local MYSQL server with the shared memory protocol turned on.
How can I connect to my server with ZeosLib? Where do I specify that it is using shared-memory?
I am using Lazarus(freepascal), although the directions would be the same for Delphi (probably).

Even if the TZConnection has no connection string property you can set the additional connection parameters in TZConnection.Properties.
I presume you run your MySQL server this way
mysqld --skip-networking --shared_memory=1 --shared-memory-base-name='MyMemoryDB'
To enable your shared memory connection you might try to add the following configuration lines into the property TZConnection.Properties at design time in Object Inspector.
Note that the protocol must be set as it is and shared-memory-base-name to the same value as you used in the command line parameter. The default value is MYSQL so if you omit the parameter in command line then you should change the following MyMemoryDB values to MYSQL.
So in TZConnection.Properties property try to add these two lines
protocol=memory
shared-memory-base-name=MyMemoryDB
or at runtime in the TZConnection.BeforeConnect event handler use
procedure TForm1.ZConnection1BeforeConnect(Sender: TObject);
begin
ZConnection1.Properties.Add('protocol=memory');
ZConnection1.Properties.Add('shared-memory-base-name=MyMemoryDB');
end;
Hope this will help you somehow. I haven't tested it because I don't have the proper environment.

IF ZeOS support it, it is probably a textual property that can be added to the (TZ)connection options. Just like other clientlib properties.

Related

Oracle Stored Procs with SSRS 2012

I've been trying to figure this out for the last day or so and after numerous attempts, I'm still struggling to find a solution. Essentially I have an Oracle Datasource setup in SSRS, where using the current "providers" available for Oracle are the following under OLE DB:
Or flat out using the "Oracle" connection type:
The issue I'm facing is when attempting to call an Oracle Stored Procedure. The only provider that seems to work is "Microsoft OLE DB Provider for Oracle" (Provider=MSDAORA;Data Source=DBNAME), where when selecting that Datasource, I can select my PROC from the drop-down (see below) and hit "refresh fields", and everything works, no problem. I don't even have to specify any parameters as it recognized them automatically and adds them. The problem is that the MSDORA is being deprecated (from what I've read), and several attempts to install ODAC (32 and 64 bit) on the server have proven unsuccessful seeing as the reporting service on the server doesn't seem to recognize the provider (tested using a UDL file).
So, figured I'd resort to using the "Oracle" provider / connection method, but despite my attempts with or without passing the parameters, I keep getting errors. Either this if I don't pass any parameters:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'SSRSTEST'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Or this error if I do add the parameter value at the end:
ORA-00911: invalid character
ORA-06512: at "SYS.DBMS_UTILITY", line 156
ORA-06512: at line 1
It's safe to assume that the data source provider is in part the source of my problem, but surely there must be a way to call an Oracle Proc via SSRS using something other than MSDORA, or at least I hope there is. I've tried installing both 32 and 64 bit versions of the Oracle client (11 and 12c), registering the dlls manually (regsvr32) but I still can't seem to resolve this. Any help would be greatly appreciated.

How do I set CBAUTH_REVRPC_URL in Couchbase N1QL?

Working with 4.0.
I ran "./cbq-engine -datastore=http://localhost:8091".
First message in the log is:
"level=ERROR msg= Unable to initialize cbauth. Error Unable to initialize cbauth's revrpc: cbauth environment variable CBAUTHREVRPC_URL is not set ".
And indeed when I try to run CREATE PRIMARY INDEX I get an error:
"Indexer not implemented GSI may not be enabled"
You should install Couchbase 4.0 and run it directly. After that, you can run cbq (not cbq-engine) as above.
You should not run cbq-engine manually.
So, in order to solve this issue you have to set a new environment variable, by doing (before calling cbq-engine)
export CBAUTH_REVRPC_URL="http://User:Pass#localhost:8091/query"
Hope this works!

Play 2 Framework - SSL Certificates from a keystore

I am trying to configure a key store in the Play server.
I was able to do this sucessfuly by define command line paramters Dhttps.keyStore and https.keyStorePassword as shown below.
... -Dhttps.keyStore="C:/tempKS/myserver.jks" -Dhttps.keyStorePassword="xxxxx" ...
My question is how to define these two properties in the application.conf instead of passing as parameters at the command line.
I tried this in the application.conf but server didn't pick those values.
https.keyStore="C:/tempKS/myserver.jks"
https.keyStorePassword="xxxxx"
Take a look at https://github.com/typesafehub/activator-play-tls-example/blob/master/app/https/CustomSSLEngineProvider.scala and set it to read from the application's Configuration object.

TEventLog does not write to systemlog

I am using Free Pascal (Lazarus) to develop a simple server daemon. The problem I am facing is that the TEventLog component does not write to the systemlog.
I use the following code:
EventLog1.LogType := ltSystem;
EventLog1.Active := True;
EventLog1.Log('Application has started!');
Instead of writing to systemlog it creates a file with the name as the executable and writes there.
Is there any other way I can write to the system log ? Is openlog defined in any unit I can use ?
(Assuming you use a *nix and the most recent 2.6.2 version).
No, libc log* functions seem only declared in the implementation of eventlog. Maybe they are in unit libc, but that is mostly unsupported, and linux/32bit only.
Check some assumptions:
Is active false before you set logtype, otherwise the active:=true might not recheck it.
you want to write system log, do you have enough privileges for that?
Do you see anything with strace/ktrace/truss ?

setting hadoop job configuration programmatically

I am getting OOM exception (Java heap space) for reduce child. I read in the documentation that increasing the value of mapred.reduce.child.java.opts to -Xmx512M or more would help. Since I am not the admin, I cannot change that value in mapred-site.xml. I would like to set that value only for my job through the java program. I tried setting it using Configuration class as follows, but that didn't work.
Configuration config = new Configuration();
config.set("mapred.reduce.child.java.opts", "-Xmx512M");
JobConf conf1 = new JobConf(config, this.getClass());
The version of Hadoop is 1.0.3
What is the proper way of setting the configuration values programmatically?
AS #ThomasJungblut and #octo have pointed out, the procedure I mentioned in the question is the right way of doing it. The OOM exception still persists, so I would start a new thread instead of continuing here.