Jump to content

DBISAM - Database Connectivity


johnp

Recommended Posts

Hello All

I have a DBISAM application that reads credentials from the RemoteUser and Remote Password properties of a DBISAM  client-server session. This has worked very well for many years with UNIGUI version 0.99.95.1303.  I recently migrated the application to a new Windows 10 Pro computer, and at the same time upgraded to DBISAM 4.48 build 6. It was running on a Windows 10 Pro system before. I also have been away from all of this for a couple of years since everything was working so well.

The issue I am having is that I get a  DBISAM 11287 error. It seems the credentials I use with setting RemoteUser or RemotePassword with Uni edit boxes that I have always used in the app will no longer work, and will not work when the login window pops up to enter the user name and password from the application. My other client server applications that access the same DBISAM database works fine on a Windows 10 machine. Otherwise the application seems to load fine. There seems to be something gone wrong in the translation with the login to the database, which I am not sure where the issue is.

The other issue is that the DBISAM login dialog box pops up on the server side since the application cannot use the data to log in as I have, and even if I try to enter credentials on the server access is denied with again the DBISAM 11287 error when my UniGui appplication is running.

Any insight will be appreciated. I am looking both here and asked DBISAM (Elevate Software) for support to try to figure this out.

On another note.  It would be nice if we maybe had a forum for Database Connectivity.

John Postnikoff, Canada

Link to comment
Share on other sites

I tried to add my session and the credentials to the server module with the same results. Can you provide a sample as you are suggesting? I have other client server database applications using the same DBISAM dataset without error, so I don't think it is a DBISAM issue.

Thanks,

 

John

Link to comment
Share on other sites

I would think it just two lines of code for my DBISAMSession1 Remoteuser Remotepassword properties that I tried to add to the servermodule that gave me an error. I am using a datamodule with my project with all DBISAM components and don't have them on my mainmodule, or perhaps there is another error altogether. I tried three different backups that worked before.

Sorry, I don't have a sample, just my project, which is quite large. Can you just provide a sample of lines of code I could try?  I tried to put my DBISAMSession component on the server as mentioned before with the same result.  I will try maybe to come up with a sample to test the login and connection. If it works for you, could you just provide just a few more details. In the meantime I will try to create a sample but will take a few days as I am more than busy. I do get a connection in the IDE when I set my session property active to true in the IDE, but again when I deploy it DBISAM prompts for a user name and password server side that it did not do before, which the credentials also do not work even though they are correct.

My other regular client server apps works fine with the same login methods on the same computer.

Thanks,

John

Link to comment
Share on other sites

  • 2 months later...

Hi There...

I also use Dbisam and there is a lot of issues that need to be addressed for it to work/adapt to uniGUI. And these issues do not  produce  the same behavior of other database such as those using Firedac or Zeos described on unigui's manual.

1- Make the connection in your datamodule. Not in ServerModule or MainMondule.  I know that is against the unigui's manual instructions but trust me, they are not talking about Dbisam anyways. It never work for me using mainmodule to connect the database, servermodule is even worst.  There is a simple reason: Dbisam works generating name sessions to db connections , if set to AutoGenerate, you get some issues that I never found solutions. But if you set AutoGenetares in DataModule, "no problemo amigo". If you set fix session name, also no problems. But in MainModule, only works with fixed names.  But when the second user login in , you have violation at the name space level since dbisam uses session unique names per app and ignores dbisam "websession" handler.

2- Dbisam generates session handlers per form (a new session at every form, does not matter if you gonna use it or not). That's is the difference. Whether you use the Tdbisamsession or not, they are always there. You can reuse other session from another form and there is no problems with it.

3- Set the Session privatedir property to Server Temp Folder. That is paramount ! Of course that depends how you handle your temp queries (if disk). For large database, I strongly suggest that you use disk and save temp data to the temp dir.

4- An Advice: Create a "main" datamodule where you connect and defines session privatedir (ops, privatedir, then connect/Open DB). Then declare the unit's name  in uses clause of other datamodule for reuse. This way you won't have to reopen the db at every form and the same session  can be used in every table or query. That makes everything "smooth and operational". I usually do that with the form uses in the login form. Then it becomes my MainDataModule. You should do it at the OnCreate event in the "MainDataModule" form and then forget about in other datamodule since the db is already open and configured.

DBisam session is not related to uniGUI (web)session. But one messes up with the other, hence the problems.

 

 

Edited by Fred Montier
typos and clarity at some points
Link to comment
Share on other sites

  • 3 weeks later...

Hi all, I found the reason ans solved the problem. When you set the autosessionname to true the component generate a new session name for each thread and assign it to all the tables and query components, but only that inside the same form or datamodule. So if you have other dataset that point to the same session but are in other forms or datamodules, you must update their sessionname to the autogenerated name of the session

Link to comment
Share on other sites

  • 4 months later...
On 11/1/2019 at 10:17 AM, Fred Montier said:

I just recently upgraded my DBISAM and uniGIU. The DBISAMSession component no longer has a PrivateDir property. I am wondering if you or anyone else is still using DBISAM. I have my session in my datamodule as I always had where it worked before, and as you suggested. For whatever reason I am not able to connect to or open my tables as I could before. I would really hate to abandon DBISAM as it has been flawless for me in other apps, especially in some pretty intense client server applications that I created.  I am wondering if you or anyone else can list the property settings for the session component as you may have along with any location to make the session active. 

John

 

On 11/1/2019 at 10:17 AM, Fred Montier said:

Hi There...

I also use Dbisam and there is a lot of issues that need to be addressed for it to work/adapt to uniGUI. And these issues do not  produce  the same behavior of other database such as those using Firedac or Zeos described on unigui's manual.

1- Make the connection in your datamodule. Not in ServerModule or MainMondule.  I know that is against the unigui's manual instructions but trust me, they are not talking about Dbisam anyways. It never work for me using mainmodule to connect the database, servermodule is even worst.  There is a simple reason: Dbisam works generating name sessions to db connections , if set to AutoGenerate, you get some issues that I never found solutions. But if you set AutoGenetares in DataModule, "no problemo amigo". If you set fix session name, also no problems. But in MainModule, only works with fixed names.  But when the second user login in , you have violation at the name space level since dbisam uses session unique names per app and ignores dbisam "websession" handler.

2- Dbisam generates session handlers per form (a new session at every form, does not matter if you gonna use it or not). That's is the difference. Whether you use the Tdbisamsession or not, they are always there. You can reuse other session from another form and there is no problems with it.

3- Set the Session privatedir property to Server Temp Folder. That is paramount ! Of course that depends how you handle your temp queries (if disk). For large database, I strongly suggest that you use disk and save temp data to the temp dir.

4- An Advice: Create a "main" datamodule where you connect and defines session privatedir (ops, privatedir, then connect/Open DB). Then declare the unit's name  in uses clause of other datamodule for reuse. This way you won't have to reopen the db at every form and the same session  can be used in every table or query. That makes everything "smooth and operational". I usually do that with the form uses in the login form. Then it becomes my MainDataModule. You should do it at the OnCreate event in the "MainDataModule" form and then forget about in other datamodule since the db is already open and configured.

DBisam session is not related to uniGUI (web)session. But one messes up with the other, hence the problems.

 

 

 

Link to comment
Share on other sites

I seem to have resolved my issue. I had to make sure that my autosession name was set to true, and set my session and tables to be active on my main form to allow the login I created . I do have my session component in the data module that I created as suggested. 

 I may have not been calling my session tables to be active soon enough. I had to give a bit of time (sleep 2000) to allow the table I needed to login to open.  I also removed the private directory  setting on my server module since the private directory property no longer exists in recent versions of DBISAM. 

Also, somehow in the process,  one of my DBISAM databases as defined by the DBISAM server utility, did not contain the defined table list that I needed when I copied over to a different machine under the database name I was using, even though the tables physicaly existed, which likely was the main problem.  Not sure how I lost those settings from the DBISAM server utility.  An oversight on my part if that makes sense. 

John P. 

Link to comment
Share on other sites

  • 2 weeks later...

I'm not with the latest versions.  Not plans to continue with DBISAM since Firedac became omnipresent and easy to use and switch between DBs. New projects just using MySql and Firebase for now. Have no intent to update to new DBISAM versions. And it looks like a dead end anyway. It's also no match to Sqlite Dbs, their "main competitor". And you can't use in FMX mobile projects... so.. So long, farewell.

And by the way, privatedir property is a "must have" for uniGUI since you can redirect temp tables, queries etc... to temp folder. It really helps in ISAPI distribution since is very common forget about W/R privileges in an IIS server. 

I put all Dbisam Logic in the datamodule since in LoginForm it is called (created) anyway and automatic generated (or created) by uniGUI. Configure and open DB/Session in Datamodule OnCreate event and you're happy and dandy.

Edited by Fred Montier
typos
Link to comment
Share on other sites

On 11/24/2019 at 4:15 PM, angman said:

Hi all, I found the reason ans solved the problem. When you set the autosessionname to true the component generate a new session name for each thread and assign it to all the tables and query components, but only that inside the same form or datamodule. So if you have other dataset that point to the same session but are in other forms or datamodules, you must update their sessionname to the autogenerated name of the session

I mean AutoSessionName IN DBISAM-TDbisamSession in a DataModule. My bad.... sorry. Not "AutoGenerates"...

Sorry it took to long to read this post again. Hope you've solved already.

Edited by Fred Montier
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...