1. Alexis Colon Lugo
  2. as SQLite DB Server
  3. Среда, Май 01 2019, 11:57 AM
  4.  Подписаться через email
Hi
i need to made one app for iPad but i need to sync with my local mini server with valentina sqlite server.

can this works or no

thanks
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
My Code
Dim sqlLocation As Text = App.mSessionURL + "/sql_fast"
mSQLSocket.Start( App.mHost, App.mSessionID, sqlLocation, "SQLite", "ipadcr", "SELECT * FROM main WHERE accnum = 1" )


pi@raspberrypi:/opt/VServer/vlogs $ sudo tail -f vserver_20190702_125935.log
2019-07-02 12:59:49.220448 (TID 1996377472): WARNING: Not found any valid license.
vServer is still working though (single connection allowed).
You need to get a FREE license with 5 Valentina DB, 10 SQLite, and 10 REST connections
OR purchase a license with more connections at Paradigma Store <http://www.valentina-db.com/en/store>;.
You will get your license file by email. Drop it into licenses folder and start server.

2019-07-02 13:00:14.101969 (TID 1866392368): (UID 20) REST connection 20892e654aac205efd602227a00bbcb1 established with '10.123.0.3:52271'. ( available: '0')
2019-07-02 13:00:15.460726 (TID 1857999664): Start parsing 'ipadcr' Access Control List (ACL).
2019-07-02 13:00:15.470052 (TID 1857999664): Finish parsing 'ipadcr' Access Control List (ACL).
2019-07-02 13:00:15.506974 (TID 1857999664): (UID 20) URI: "/rest/session_20892e654aac205efd602227a00bbcb1;/sql_fast". Error - "Sqlite db "/opt/VServer/databases_sqlite/ipadcr": Error : "unable to open database file".".
Вложения
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
ok
So what is rest port number, I can check
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
You define port yourself, there is no default value.

Check /opt/VServer/vserver.ini

You can change it right here, like:
PORT_REST=8080

and restart the server
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
if i use 8080 then no logs create but if I use 15532, i have logs.
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
thanks, Sergey
Now works I set my own ports
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
Hi
Is working but if i have an error i have to reboot the PI to reconnect way is this, any idea
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
HTTPStatus=503
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Please attach a few latest log files from the server
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
2019-06-27 16:42:07.565759 (TID 1882952496): (UID 20) Closing database '(null)': OK
2019-06-27 16:42:07.565850 (TID 1882952496): (UID 20) Database 'ipadprojects.vdb' object memory released.
2019-06-28 11:04:58.341703 (TID 1795158832): (UID 20) REST connection 1ffdbcd76c93572181502759320f56e7 established with '10.123.0.3:49476'. ( available: '0')
2019-06-28 11:05:05.293381 (TID 1786766128): Start parsing 'iPadProjects.db' Access Control List (ACL).
2019-06-28 11:05:05.295106 (TID 1786766128): Finish parsing 'iPadProjects.db' Access Control List (ACL).
2019-06-28 11:05:05.297256 (TID 1786766128): (UID 20) Database '(null)' remoteID 1796267000 registered.
2019-06-28 11:05:05.297427 (TID 1786766128): (UID 20) Database '(null)' remoteID 1796267000 unregistered.
2019-06-28 11:05:05.298853 (TID 1786766128): (UID 20) URI: "/rest/session_1ffdbcd76c93572181502759320f56e7;/sql_fast". Error - ""ipadprojects.vdb" invalid database name.".
2019-06-28 11:05:11.050732 (TID 1778373424): (UID 0) ERROR 0x82501: Connection limit reached.
2019-06-28 11:05:11.051316 (TID 1778373424): (UID 20) URI: "/rest". Error - "Service unavailable".
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
There are a few questions about this log file entries.

1) The name of your database is "ipadprojects.vdb" in lower case, right? It is important because linux filesystem is case-sensitive.
Please check it with ls -l /opt/VServer/databases

It is better to keep it in lower case.

2) To execute SQL, you specify database without an extension, like here:

Dim sqlLocation As Text = App.mSessionURL + "/sql_fast"
mSQLSocket.Start( App.mHost, App.mSessionID, sqlLocation, "Valentina", "valentina_sakila", "SELECT * FROM actor WHERE actor_id = 1" )


3) Are you sure the license is recognized? Please check at the beginning of the log file

Licence license_lin_4439408093954748 is registered to user_name.
Valid until 9999-12-31. Subscription valid until 2019-12-30.


And the following row:

Maximum number of REST connections :


How many connections are there?
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
Hi this is correct or no
i do no see my db names ?

pi@raspberrypi:/opt/VServer/databases $ sudo ls -l /opt/VServer/databases
total 2352
-rw------- 1 root root 2461696 Apr 9 11:49 master.vdb
-rw------- 1 root root 4096 Jul 2 09:19 master.vdb.journal
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
look Valentina Studio
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
So SQLite database has upper-case letters, and you query it like here

Dim sqlLocation As Text = App.mSessionURL + "/sql_fast"
mSQLSocket.Start( App.mHost, App.mSessionID, sqlLocation, "SQLite", "iPadProjects.db", "SELECT * FROM ..." )


Right?

What about the license, according to the log it is not properly loaded - you should check the beginning of the log file like I wrote before.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
1) Is the license loaded?
2) This log shows connection to SQLite port, not the REST port.

With REST, log entry looks like:
Tue Jun 25 2019 20:18:44.416478 (TID 123145510604800): (UID 28) REST connection 5922523de3dc5f1316bf4aba57eebedb established with '127.0.0.1:61753'. ( available: '4')
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
For SQLite databases it is necessary to write database name with extension - ipadcr.db

Do you have a license in /opt/VServer/licenses?
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
yes lic is on the folder

pi@raspberrypi:/opt/VServer/licenses $ sudo ls
serials_190525 00105711.csv
Вложения
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
the info look ok
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
The correct license file is named like:
license_lin_1234567890123456

Please add log entries about error - "unable to open database file".".
Комментарий
There are no comments made yet.
Alexis Colon Lugo Ответ принят
pi@raspberrypi:/opt/VServer/vlogs $ sudo tail -f vserver_20190702_145540.log
2019-07-02 16:12:34.276280 (TID 1767887664): (UID 19) SqliteStatement 'SELECT RowID AS RowID, "accnum", "nombre", "apellidos", "tel", "email", "locate" FROM "main" ORDER BY "RowID" ASC LIMIT 500 OFFSET 0' remoteID 1816411040 registered.
2019-07-02 16:12:34.282497 (TID 1767887664): (UID 19) SqliteCursor remoteID 1816320744 registered.
2019-07-02 16:12:34.289773 (TID 1742709552): (UID 19) ERROR 0x68500: Sqlite db "ipadcr.db": Error : "cannot commit - no transaction is active".
2019-07-02 16:12:34.293344 (TID 1767887664): (UID 19) SqliteStatement 'SELECT RowID AS RowID, "accnum", "nombre", "apellidos", "tel", "email", "locate" FROM "main" ORDER BY "RowID" ASC LIMIT 500 OFFSET 0' remoteID 1816411040 unregistered.
2019-07-02 16:12:34.293544 (TID 1767887664): (UID 19) SqliteCursor remoteID 1816320744 unregistered.
2019-07-02 16:12:48.999540 (TID 1742709552): (UID 19) Closing SqliteDatabase 'ipadcr.db': OK
2019-07-02 16:12:48.999775 (TID 1742709552): (UID 19) SqliteDatabase 'ipadcr.db' remoteID 1837193216 unregistered.
2019-07-02 16:12:49.029642 (TID 1742709552): (UID 19) Closing SqliteDatabase 'iPadProjects.db': OK
2019-07-02 16:12:49.029872 (TID 1742709552): (UID 19) SqliteDatabase 'iPadProjects.db' remoteID 1816185120 unregistered.
2019-07-02 16:12:49.029999 (TID 1742709552): (UID 19) Closing vSqlite-connection. ( vSqlite-connections count: '0'. Available: '1')
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
It is necessary to place the correct license file and restart the system.
Without the license, only one connection works and if you don't close it - the next connection attempt you get Error - "Service unavailable".
Комментарий
There are no comments made yet.
  • Страница :
  • 1
  • 2
  • 3


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories