Hi there BaseX people!

 

Original post on StackOverflow:
http://stackoverflow.com/questions/38086358/starting-multiple-sessions-in-ba
sex-with-perl-compilation-failed-at-carp-pm

 

I wanted to see if I could start multiple BaseX sessions (on a single
server) to try some things out, but I can't even get the sessions to launch
- heck, I can't even get the Perl script to compile! This is odd to me,
because the same code works perfectly without multiple sessions.

 

Let's say I have a subroutine that creates sessions given an amount. E.g.
the following code would create 3 sessions (variables for dbhost, user and
password left out):

 

CreateSessions(3);

 

# For testing

my $session = $sessions[0];

 

sub CreateSessions {

  my ($amountofsessions) = @_;

  our @sessions = ();

  for (my $i = 0; $i < $amountofsessions; $i++) {

    my $session = Session->new($dbhost, 1950, $usr, $pw);

    push(@sessions, $session);

  }

}

 

I also tried other approaches, e.g. creating each session individually and
assigning it to a variable, and then building an array with these variables.
The same problem occurs:

 

Compilation failed in require at /usr/share/perl5/Carp.pm line 33.

 

When I look up that file and that line, it states:

 

eval { require Carp::Heavy };

 

 

Which, I guess, means that I don't have the Carp module installed? But I do
not understand why I would need this, and why that the Perl script works
when I only create one session.

 

Is it possible to launch multiple sessions from Perl that can work
simultaneously, and if so, how do you launch these sessions and access them?
It's important to note that in PHP, for another project but the same
database, having multiple sessions does work. In other words, there I can
have multiple sessions that run in parallel.

 

We're on BaseX 7.9 and Perl 5.10.1. (Old, I know, but I can't change it.)

 

 

Thank you for your time!

 

Bram

Reply via email to