1. Beatrix Willius
  2. as SQLite DB Server
  3. Sunday, April 19 2020, 12:17 PM
  4.  Subscribe via email
The example on SQLite says to use the following code to connect to VSqlite:


db.Host = "localhost"
db.UserName = "sa"
db.Password = "sa"
db.Port = 15532 // optional. You can change port for SQLite DB connections in the VServer.ini file.
Connected = db.Connect()


That could work. But I get "wrong deployment serial" when running the code. I also find nothing where I could use the deployment serial.

When using the documentation at roducts:adk:api:vsqlitedatabase_class:construction_methods" target="_blank" rel="nofollow">https://valentina-db.com/docs/dokuwiki/v10/doku.php?id=valentina:products:adk:api:vsqlitedatabase_class:construction_methods I get a VConnection where I can put my serial. But then the code doesn't compile:


'works
SQLiteConnection = new VConnection("127.0.0.1", "sa", "sa")
SQLiteConnection.Open
'no compile
remote_db = new VSqliteDataBase(SQLiteConnection, "db1")
Call remote_db.create
remote_db.Close


Which should work - the example or the docs? Why does neither work?
Comment
There are no comments made yet.
Beatrix Willius Accepted Answer
Forgot as usual the versions:

macOS 10.15.4
Valentina latest version
Xojo: latest beta
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 1
Ruslan Zasukhin Accepted Answer
Hi Trixi,

embedded serial, this is because you have Valentina Embedded Server, and it requires that.

VSqliteDataBase class has the property

EmbeddedSerial as String

assign your embedded signature to this property before do Connect.

Notice, that SQLite in V4RB works via RBDB API, according to docs of Xojo.
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 2
Beatrix Willius Accepted Answer
Thanks, I'll try that. What about using a connection? Is this possible or are the docs wrong?
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 3
Ruslan Zasukhin Accepted Answer
Which exactly docs? Give please URL of page
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 4
Beatrix Willius Accepted Answer
Well, that didn't go well. After adding my embedded serial like this here:


app.db = new VSqliteDataBase
app.db.EmbeddedSerial = conserv
Dim Connected as Boolean
if( gClient ) then
db.Host = "localhost"
db.UserName = "sa"
db.Password = "sa"
db.Port = 15532 // optional. You can change port for SQLite DB connections in the VServer.ini file.
Connected = db.Connect()


I tried to run the app in the debugger. I get a hard crash of the debugger EVERY TIME when trying to connect. macOS 10.15.5.

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [62503]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_malloc.dylib 0x00007fff7189df3e nanov2_allocate_from_block.cold.1 + 31
1 libsystem_malloc.dylib 0x00007fff7187e9b1 nanov2_allocate_from_block + 574
2 libsystem_malloc.dylib 0x00007fff7187df2b nanov2_allocate + 130
3 libsystem_malloc.dylib 0x00007fff7187de58 nanov2_malloc + 56
4 libsystem_malloc.dylib 0x00007fff7187dd7a malloc_zone_malloc + 104
5 libsystem_malloc.dylib 0x00007fff7187dcf5 malloc + 21
6 XojoFramework 0x0000000101d1c335 AllocateBuffer(unsigned long) + 23
7 XojoFramework 0x0000000101d1c3b1 StringOpsClassic::ConstructFromBuffer(char const*, unsigned int, int) + 39
8 XojoFramework 0x0000000101d2bb42 string::ConstructFromBuffer(char const*, unsigned long, unsigned int) + 78
9 XojoFramework 0x0000000101d2c727 operator+(string const&, string const&;) + 117
10 XojoFramework 0x0000000101d188de TCPSocketPosix::SendData(string) + 146
11 XojoFramework 0x0000000101e6b672 TCPSocketConnection::SendPacket(DebuggerPacketBuilder const&;) + 212
12 XojoFramework 0x0000000101da218f 0x101bfc000 + 1728911
13 XojoFramework 0x0000000101ebad57 std::__1::function<bool (long, long)>::operator()(long, long) const + 39
14 XojoFramework 0x0000000101ebad10 StackContext::Crawl(StackBounds, std::__1::function<bool (long, long)>;) const + 128
15 XojoFramework 0x0000000101d9bbdc 0x101bfc000 + 1702876
16 XojoFramework 0x0000000101d9960b DSDelegate::DebuggerConnectionMessage(DebuggerPacketParser const&;) + 17
17 XojoFramework 0x0000000101d97a45 DebuggerConnection::ProcessMessage(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >;) + 67
18 XojoFramework 0x0000000101e6ba68 TCPSocketConnection::SocketDataReceived(TCPSocket*) + 370
19 XojoFramework 0x0000000101d1b4a7 TCPSocket::FireEvents() + 123
20 XojoFramework 0x0000000101d180cd TCPSocketPosix::Poll() + 925
21 XojoFramework 0x0000000101da07ce 0x101bfc000 + 1722318
22 XojoFramework 0x0000000101da05e7 DebuggerHook + 836
23 vSqliteExample.debug 0x0000000101a57f2e App.Event_Open%%o<App> + 2462 (/App:29)
24 XojoFramework 0x0000000101cdc2d7 CocoaFinishApplicationStartup() + 153
25 XojoFramework 0x0000000101cdae7a 0x101bfc000 + 913018
26 com.apple.CoreFoundation 0x00007fff3722c9af __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
27 com.apple.CoreFoundation 0x00007fff3722c943 ___CFXRegistrationPost1_block_invoke + 63
28 com.apple.CoreFoundation 0x00007fff3722c8b8 _CFXRegistrationPost1 + 372
29 com.apple.CoreFoundation 0x00007fff3722c524 ___CFXNotificationPost_block_invoke + 80
30 com.apple.CoreFoundation 0x00007fff371fc69d -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1554
31 com.apple.CoreFoundation 0x00007fff371fbb49 _CFXNotificationPost + 1351
32 com.apple.Foundation 0x00007fff39918866 -[NSNotificationCenter postNotificationName:object:userInfo:] + 59
33 com.apple.AppKit 0x00007fff344cf153 -[NSApplication _postDidFinishNotification] + 312
34 com.apple.AppKit 0x00007fff344cee92 -[NSApplication _sendFinishLaunchingNotification] + 208
35 com.apple.AppKit 0x00007fff344c6004 _DPSNextEvent + 1758
36 com.apple.AppKit 0x00007fff344c44e0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
37 XojoFramework 0x0000000101cdcab5 0x101bfc000 + 920245
38 XojoFramework 0x0000000101cdcaf9 0x101bfc000 + 920313
39 vSqliteExample.debug 0x00000001018e2cc5 Application._CallFunctionWithExceptionHandling%%o<Application>p + 181
40 XojoFramework 0x0000000101e6aa99 CallFunctionWithExceptionHandling(void (*)()) + 262
41 XojoFramework 0x0000000101cdca62 0x101bfc000 + 920162
42 com.apple.AppKit 0x00007fff344b61ee -[NSApplication run] + 658
43 XojoFramework 0x0000000101e68ea5 RuntimeRun + 42
44 vSqliteExample.debug 0x000000010197c0d3 REALbasic._RuntimeRun + 19
45 vSqliteExample.debug 0x0000000101a6a2ee _Main + 846 (/#main:63)
46 vSqliteExample.debug 0x0000000101a695e3 main + 19
47 libdyld.dylib 0x00007fff716c7cc9 start + 1



According to the docs (the url was mangled, it's the main page on VSQLiteDatabase class) I can use this code here:

SQLiteConnection = new VConnection("127.0.0.1", "sa", "sa")
SQLiteConnection.Open
remote_db = new VSqliteDataBase(SQLiteConnection, "db1") '1
remote_db.create '2


But the code doesn't compile:

1: requires fewer parameters
2: has no member create, the same is true for open, by the way.
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 5
Beatrix Willius Accepted Answer
The VSQLite example doesn't crash on High Sierra. But still it's not possible to connect. The property "connected" is always false.
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 7
Beatrix Willius Accepted Answer
Me stupid - as usual. The logs say that the deployment serial is wrong. Isn't this the same serial as for VServer?
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 8
Ruslan Zasukhin Accepted Answer
Well, this should be the same embedded serial.
We need double check

You can meanwhile use not emb_license but normal license for vserver (even free)
to continue development
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 9
Beatrix Willius Accepted Answer
I forgot the nfr license. This license works fine.

I made a couple of bug reports. The computer with Catalina is not my main development machine. But I do a lot of testing on the computer. Please fix the bug with the debugger in Xojo soon.

I'll send you a separate email with the serial problem.
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 10
Ruslan Zasukhin Accepted Answer
From Ivan,

1)

I was to fast with conserv fixes - some strange crashes happen randomly with that fix.
No idea how correctly implement this, but if you stay conserv untouched and do following:

dim options as string
options = conserv()
options = options.DefineEncoding(Encodings.UTF8)
app.db.EmbeddedSerial = options

it works ok.


2)

It is really strange but it works even without options.DefineEncoding(Encodings.UTF8)

It is ok:
--------------
dim options as string
options = conserv
app.db.EmbeddedSerial = options

It is not ok:
--------------
app.db.EmbeddedSerial = conserv()
Comment
There are no comments made yet.
  1. more than a month ago
  2. as SQLite DB Server
  3. # 11
  • Page :
  • 1


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