November 20, 2008, 11:52:13 am *
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Database requirements of tutorial  (Read 6244 times)
olhotak
Newbie
*
Posts: 8


« on: April 10, 2007, 06:12:24 pm »

I would like to know whether the SemmleCode Tutorial specifically requires PostgreSQL, or whether it can be made to work with the other database backends.

I have been going through the SemmleCode Tutorial and got stuck with the database stuff.

At first, I wanted to avoid installing PostgreSQL. Running without a database, I got the warning about "Demo Mode". What exactly does Demo Mode mean? The warning says that a database is required to query code; what else is there to do other than querying code?

I then tried the built-in databases. With H2, when I run the Fan In example from the tutorial, I get an error message saying: "An internal error occurred during query processing. Please consider submitting
a bug report".

With HSQLDB, I get an error as soon as I switch to the HSQLDB database in the preferences. The error is: "Cannot start backend. JDBC driver org.hsqldb.jdbcDriver not found > org.hsqldb.jdbcDriver".

I did try installing PostgreSQL. However, I am running Debian rather than Fedora, so I did not follow the Fedora installation instructions. Instead, I installed the Debian postgresql-8.1 package (actually, Debian first installed 7.4 by default, but I uninstalled that and forced it to install 8.1). Is 8.2 required, or is it possible to get SemmleCode working with 8.1? Unfortunately, I don't know much about PostgreSQL, and I haven't yet figured out where the Debian version keeps the configuration files mentioned in the Fedora Step-by-Step Install. I have no /sbin/service or /var/lib/pgsql/pg_hba.conf.

One final question: at one point, SemmleCode popped up a wizard for configuring (and auto-detecting) the database. Is there a way to invoke that wizard at a later time, once I do get PostgreSQL installed?
Logged
Pavel Avgustinov
Administrator
Newbie
*****
Posts: 5


« Reply #1 on: April 11, 2007, 09:17:33 am »

Hi Ondrej,

The in-memory backends are indeed currently not suitable for running the tutorial -- having said that, we are working on providing such compatibility, at least for one of them, in our upcoming next release.

We will also add instructions for setting up PostgreSQL on Debian soonest. SemmleCode requires a Postgres version of 8.1 or later, so the package you installed should be fine. Indeed, the Debian package takes care of some of the configuration steps described in the Fedora-specific instructions.

Once you've installed it, all you need to do (assuming there were no errors and you now have a running postgres instance) is to give the superadmin database user a password that you can provide for SemmleCode's wizard. This can be done as follows:
  • Open a root shell (by typing 'su' and your root password, or 'sudo bash' if you have sudo access).
  • Type 'su postgres' to open a shell as the postgres system user.
  • Run 'psql'
  • Enter the following SQL command: ALTER USER postgres WITH PASSWORD ‘newpassword’;, press Enter, then press ctrl+d to exit. Exit all the shells -- you are done!

To run the database setup wizard again, locate the drop-down menu (usually a downward-pointing triangle, next to the 'populate database' icon) on any SemmleCode view, and select "Setup Wizard" from the menu.

Hope this helps,
- Pavel
Logged
elnar
Administrator
Newbie
*****
Posts: 17


« Reply #2 on: April 11, 2007, 09:29:32 am »

SemmleCode Tutorial indeed requires either Postgres 8.1(or later) or MS SQL 2005 database server. Even though it works with in-memory database systems such as H2 and HSQLDB, their support is currently in alpha stage, and some features such as aggregates do not work. This is the reason why FAN-IN query did not execute. We are currently working on this issue and hope to resolve the problem by the next release.
Logged
olhotak
Newbie
*
Posts: 8


« Reply #3 on: April 11, 2007, 01:42:56 pm »

Thanks for the help. Pavel's instructions worked perfectly.
Logged
elnar
Administrator
Newbie
*****
Posts: 17


« Reply #4 on: April 20, 2007, 02:09:31 pm »

Hi Ondrej,

just wanted to let you know that in the new recently released version 0.1.2 of our plugin, the tutorial fan-in query should be now working with H2.

Elnar
Logged
Pages: [1]
  Print  
 
Jump to: