pyorient icon indicating copy to clipboard operation
pyorient copied to clipboard

getting info on connected databases

Open gg4u opened this issue 10 years ago • 8 comments

Hello, I connected to the db. then I try again:

info = client.db_open( db_name, "user", "pwd" ) the console hangs and have to keyboard interrupt.

` ^CTraceback (most recent call last): File "", line 1, in File "pyorient/orient.py", line 234, in db_open .prepare(args).send().fetch_response() File "pyorient/messages/database.py", line 101, in fetch_response result = super( DbOpenMessage, self ).fetch_response() File "pyorient/messages/base.py", line 216, in fetch_response self._decode_all() File "pyorient/messages/base.py", line 200, in _decode_all self._decode_header() File "pyorient/messages/base.py", line 141, in _decode_header self._header = [ self._decode_field( FIELD_BYTE ), File "pyorient/messages/base.py", line 308, in _decode_field _value = self._orientSocket.read( _type['bytes'] ) File "pyorient/orient.py", line 96, in read select.select( [self._socket, ], [], [self._socket, ], 30 ) KeyboardInterrupt

`

it looks it works only a first time. so how to get information not only on the classes but also on the commands? Which property of the returned object should be accessed?

gg4u avatar Aug 19 '15 10:08 gg4u

How did you instantiate pyorient.OrientDB? Are you able to connect to the database successfully using the OrientDB console?

lebedov avatar Aug 19 '15 13:08 lebedov

yes, I am able to connect to the console.

gg4u avatar Aug 19 '15 14:08 gg4u

When you connect through the console, are you accessing the database as a remote or plocal? I.e., are you connecting using connect remote:localhost/db_name user pwd?

lebedov avatar Aug 19 '15 21:08 lebedov

I can do it as a remote. please note I recreated the db with .STORAGE_TYPE_PLOCAL (before when I had the problem it was on memory) .

gg4u avatar Aug 20 '15 08:08 gg4u

The db storage type shouldn't matter from the perspective of pyorient because it is accessing everything over a network socket even if you are using it on system running the OrientDB server.

Perhaps there are some firewall rules set up on your system that interfere with accessing port 2424 locally? I can't reproduce this problem on my Linux system using the latest code from GitHub master.

lebedov avatar Aug 20 '15 13:08 lebedov

mm no, no firewall here. I destroyed and recreated in PLOCAL - (I am not saying that MEMORY was the cause, but now can connect and get info).

gg4u avatar Aug 21 '15 10:08 gg4u

Not sure what went wrong; I was able to connect to a memory db served by OrientDB 2.1.0 using pyorient.

lebedov avatar Aug 21 '15 16:08 lebedov

Hi @gg4u, I couldn't replicate this problem, are you running something like this:

  import pyorient
  db_name = "GratefulDeadConcerts"
  client = pyorient.OrientDB("localhost", 2424)
  cluster_info = client.db_open( db_name, "admin", "admin" )
  print(cluster_info)

  cluster_info2 = client.db_open( db_name, "admin", "admin" )
  print(cluster_info2)

cause it doesn't hangs up at all, anyway your need make sense there should be a way to get cluster information from the Orient object, so you don't have to call db_open twice, it doesn't make sense

mogui avatar Aug 26 '15 15:08 mogui