cancel
Showing results for 
Search instead for 
Did you mean: 

DBENG17 Running on 2 processes

Former Member
0 Kudos

Hi Experts.

I have found that when I run my script, it is ran by the SYSTEM user and not my current user. My issue here is that after running the script below, our application would run a synchronization script for Mobilink. From there, the script is failing since it is running another DBENG17.exe process under my user and not by the SYSTEM user. Any suggestions how to ensure that dbeng17 is only ran by one process?

@echo off


:step1
echo creating db service
dbsvc -as -s auto -y -w Mosis "%ProgramFiles%\SQL Anywhere 17\Bin64\dbeng17.exe" -n Mosis -x "tcpip(port=2638)" -c 8m "C:\Users\*user*\Documents\Eclipse Oxygen\Application\db\mosis.db"
if %errorlevel% == 0 goto step2
echo ASA service already started
goto end


:step2
echo starting db service
dbsvc -u Mosis


:step3
echo ASA start successful


:end
exit
chris_keating
Advisor
Advisor
0 Kudos

The script setups and starts a SQL Anywhere personal service SYSTEM service. This script will fail at Step 2 if the service is running when it is executed.

If I understand what is described

  • The script is run. This creates and starts an engine with the name Mosis running on TCPIP port 2638. This process is owned by SYSTEM.
  • You establish a connection to a database from your application.
  • After running the application, you have an SQL Anywhere engine running in an user account.

A second engine will not be started if

  • the database server name is the same
  • the port is the same

Can you share the connection string that you are using in your application? For it to use the service, the string should look like:

eng=Mosis;dbn=Mosis,uid=<uid>;pwd=<pwd>;links=tcpip(port=2639)

Former Member
0 Kudos

Hi.

Here's the connection string we use:

Uri = jdbc:sybase:Tds:localhost:2638

reimer_pods
Participant
0 Kudos

If different processes require access to the same database, I would recomment creating a service to run the database server.

See DCX SQLA 17 Database Servers

chris_keating
Advisor
Advisor
0 Kudos

Based on the service definition and the URL, there should be only one engine instance running after the process. If you do the following

  • run script
  • run app
  • run script

The second run script will report that the service is already running when this is executed:

dbsvc -u Mosis

There is certainly not enough information to explain a second engine instance as you have described the environment. Perhaps you can get Process Explorer from Microsoft SysInternals to help get more information about the SQL Anywhere instances that are running. For example, I have a service based on the script and a second engine running on my machine. According to process monitor, I can see the service command line

<path to exe>\dbeng17.exe -hvSQLANYe_demo17

and the standalone command line (running under an user account)

dbeng17 -n keating -x tcpip

With this information, I can investigate the source of the user account dbeng17 instance.

Former Member
0 Kudos

Hi Chris.

Is there a way to make sure that dbeng17 will be ran by the user account instead of the SYSTEM account? Just to eliminate this issue.

chris_keating
Advisor
Advisor
0 Kudos

That will not solve the problem you describe. You cannot run two engines with the same name and/or port. That will fail. If you expect two engines to be running in this environment, you need to provide unique names and ports (an adjust the connection information accordingly). If you only want one engine but run multiple databases, you can do that also - here is an example of an engine running to two databases with TCPIP:

  • dbeng17 -x tcpip -n DbSrvName db1.db -n Database1Name db2.db -n Database2Name

** dbeng17 only permits 10 local connections

  • Engine Name: DbSrvName
  • db1.db Name: Database1Name
  • db2.db Name: Database2Name

If you want to connect to a specific database, the connectior url would be:

jdbc:sybase:Tds:host:port?ServiceName=database

Here is the url for db1.db

jdbc:sybase:Tds:localhost:2638?ServiceName=Database1Name

and db2:

jdbc:sybase:Tds:localhost:2638?ServiceName=Database2Name

If that second engine is not expected, you need to figure out its source. You may be forced to change configuration if that other engine is later determined as expected.

Former Member
0 Kudos

Just to add.

A dbeng17 is being ran whenever the Mobilink synchronization is triggered. That dbeng17 during this process is being ran under the local user account instead of the local system. This is what I don't understand as to why it won't run under the SYSTEM account.

chris_keating
Advisor
Advisor
0 Kudos

Is that sync intended to use the database that you are running in the service? What is the connection string for the synchronization?


Accepted Solutions (0)

Answers (0)