0

我必须从 OrientDB 阅读。为了测试一切正常,我尝试使用SELECT语句从数据库中读取。像这样:

import pyorient

client = pyorient.OrientDB("adress", 2424)
session_id = client.connect("root", "password")
client.db_open("table","root","password")
print str(client.db_size())
client.query("SELECT * FROM L1_Req",1)

连接工作正常,print str(client.db_size())线路也很好。

client.query("SELECT * FROM L1_Req",1)它返回以下错误消息:

Traceback (most recent call last):
  File "testpy.py", line 9, in <module>
    client.query("SELECT * FROM L1_Req",1)
  File "C:\app\tools\python27\lib\site-packages\pyorient\orient.py", line 470, i
n query
    .prepare(( QUERY_SYNC, ) + args).send().fetch_response()
  File "C:\app\tools\python27\lib\site-packages\pyorient\messages\commands.py",
line 144, in fetch_response
    super( CommandMessage, self ).fetch_response()
  File "C:\app\tools\python27\lib\site-packages\pyorient\messages\base.py", line
 265, in fetch_response
    self._decode_all()
  File "C:\app\tools\python27\lib\site-packages\pyorient\messages\base.py", line
 249, in _decode_all
    self._decode_header()
  File "C:\app\tools\python27\lib\site-packages\pyorient\messages\base.py", line
 176, in _decode_header
    serialized_exception = self._decode_field( FIELD_STRING )
  File "C:\app\tools\python27\lib\site-packages\pyorient\messages\base.py", line
 366, in _decode_field
    _decoded_string = self._orientSocket.read( _len )
  File "C:\app\tools\python27\lib\site-packages\pyorient\orient.py", line 164, i
n read
    buf = bytearray(_len_to_read)
MemoryError

我还尝试了一些其他 SQL 语句,例如:

client.query("SELECT subSystem FROM L1_Req",1)

我不明白为什么会这样。你们能帮帮我吗?

4

0 回答 0