[orientdb] Re: Two-way link in document mode from console in 2.0.3?

2015-03-04 Thread Sergey Dashko
Thank you Colin.
Regards

среда, 4 марта 2015 г., 21:22:11 UTC+2 пользователь Colin написал:
>
> Hi Sergey.
>
> What you did via the console looks fine.
>
> Try:
>
> select expand(comments) from Post to display a list of the comments.
>
> -Colin
>
> Orient Technologies
>
> The Company behind OrientDB
>
>
> On Wednesday, March 4, 2015 at 2:44:18 AM UTC-6, Sergey Dashko wrote:
>>
>> Hello.
>> Trying to link two classes like this:
>> create class Post
>> create class Comment
>> create property Post.title string
>> create property Comment.title string
>> create property Post.comments LINKSET Comment
>> create property Comment.post Link Post
>>  insert into Comment content {title: 'Comment1'}
>>
>> Inserted record 'Comment#17:0{title:Comment1} v1' in 0.005000 sec(s).
>>
>> insert into Post content {title: 'Post1'}
>>
>> Inserted record 'Post#16:0{title:Post1} v1' in 0.002000 sec(s).
>>
>> Now linking:
>> update #17:0 SET post=#16:0
>> update #16:0 ADD comments=#17:0
>>
>> Result:
>> select from Comment
>> +-+---++-
>> #   |@RID |@CLASS |title   |post
>> +-+---++-
>> 0   |#17:0|Comment|Comment1|#16:0
>>
>>
>> select from Post
>> +-+--+-+
>> #   |@RID |@CLASS|title|comments
>> +-+--+-+
>> 0   |#16:0|Post  |Post1|[1]
>>
>> Now questions. 
>> 1) If what I'm doing is correct way to build two-way linking for 
>> documents?
>> 2) If yes, how can I retrieve list of comments for post?
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: [Studio version : 2.0 OrientDB version : 2.0.3] ETL - Importing JSON to OrientDB

2015-03-04 Thread Kiheung Park
So I changed into 'graph' (database type) and tried.

And the error message says "The process cannot access the file because 
another process has locked a portion of the file."

Thus, from the source section on json file, I have changed "lock" to false 
instead true. NOW IT SEEMS RUNNING BUT FAILED TO FULLY OPERATED.

Got a new error that saying, "the class 'Politician' does not extend class 
'V' and therefore cannot be considered a Vertex."

I have created class 'Agent' extends class 'V', then created class 
'Politician' extends class 'Agent'.

How should I change the following (bold) area. Please help me sir...

{
"config": {
"log": "debug"
},
"begin": [
],
"source": {
"file": { "path": "politician_sample.json", "lock": false }
},
"extractor": {
"json": {}
},
"transformers": [
* { "vertex": { "class": "Politician"}}*
],
"loader": {
"orientdb": {
"dbURL": "plocal:../databases/AgentDatabase_Document",
"dbUser": "admin",
"dbPassword": "admin",
"dbAutoCreate": false,
"standardElementConstraints":  false,
"tx": false,
"batchCommit": 1000,
"dbType": "graph",
*"classes": [{ "name": "Politician", "extends": "Agent" } ],*
"indexes": [{ "class": "Politician", "fields": ["name:string"], 
"type":"NOTUNIQUE_HASH_INDEX" }]
}
}
}


On Wednesday, March 4, 2015 at 10:45:45 PM UTC-5, Kiheung Park wrote:
>
> I have fixed *ETLPolitician.json* as follow:
>
> {
>> "config": {
>> "log": "debug"
>> },
>> "begin": [
>> ],
>> "source": {
>> "file": { "path": "./ETLPolitician.json", "lock": true }
>> },
>> "extractor": {
>> "json": {}
>> },
>> "transformers": [
>> { "document": { "class": "Politician"}}
>> ],
>> "loader": {
>> "orientdb": {
>> "dbURL": "plocal:../databases/AgentDatabase_Document",
>> "dbUser": "admin",
>> "dbPassword": "admin",
>> "dbAutoCreate": false,
>> "standardElementConstraints":  false,
>> "tx": false,
>> "batchCommit": 1000,
>> "dbType": "document",
>> "classes": [{ "name": "Politician", "extends": "Agent" } ],
>> "indexes": [{ "class": "Politician", "fields": 
>> ["name:string"], "type":"NOTUNIQUE_HASH_INDEX" }]
>> }
>> }
>> }
>
>
> And now having another error message,
>
>
> 
> Is ETL only support 'graph' type database? Should I go for graph? 
>
> Best, 
>
> Ki
>
>
>
>
> On Wednesday, March 4, 2015 at 7:06:02 PM UTC-5, Kiheung Park wrote:
>>
>> Hi,
>>
>> I want to load JSON formatted data into OrientDB. I have studied all the 
>> tutorial materials and sample codes that are provided by orient 
>> technologies teams. 
>> However, I am having a hard time to figuring what did I do wrong when 
>> importing JSON.
>>
>> I have already designed the document based database called 
>> "AgendDatabase_Document" and here is schema of Politician Class:
>>
>>
>> 
>> And here is my sample json (input file / *source*):
>>
>> [{
>>> "affiliatedCommittee": [
>>> "국회운영위원회",
>>> "안전행정위원회"
>>> ],
>>> "age": 0,
>>> "birthPlace": "",
>>> "birthday": "6/4/1960",
>>> "class": "Politician",
>>> "constituency": "경남 창원시성산구",
>>> "contact": {
>>> "address": null,
>>> "class": "Contact",
>>> "phoneNumber": null
>>> },
>>> "education": {
>>> "class": "Education",
>>> "degreeStatus": null,
>>> "department": null,
>>> "highschool": "마산공업고등학교",
>>> "major": null,
>>> "university": null
>>> },
>>> "experience": {
>>> "class": "Experience",
>>> "experience": [
>>> "경남도의회 의원 (7대, 8대), 새누리당 경남도당 수석부대변인"
>>> ]
>>> },
>>> "gender": true,
>>> "group": [
>>> "19"
>>> ],
>>> "military": "",
>>> "name": "강기윤",
>>> "nationality": "대한민국",
>>> "partyName": "새누리당"
>>> }]
>>
>>
>>
>> And here is my *ETLpolitician.json *on bin directory.
>>
>>> {
>>> "config": {
>>> "log": "debug"
>>> },
>>> "begin": [
>>> ],
>>> "source": {
>>> "file": { "path": "./ETLPolitician.json", "lock": true } //have tried 
>>> ETLPolitician.json, but didn't work as well...
>>> },
>>> "extractor": {
>>> "json": {}
>>> },
>>> "transformers": [
>>> { "document": { "class": "Politician"}}
>>> ],
>>> "loader": {
>>> "orientdb": {
>>> "dbURL: "plocal:../databases/AgentDatabase_Document",
>>> "dbUser": "admin",
>>> "dbPassword": "admin",
>>> "dbAutoCreate": false,
>>> "tx": false,
>>> "batchCommit": 1000,
>>> "dbType": "document"
>>> }
>>> },
>>> } 
>>
>>
>> When I run *oetl.bat ETLPolitician.json *, I got following error 
>> message...
>>
>>
>> 
>>  
>> Can anyone help me on importing JSON? DEFINITELY NEED MORE 
>> DOCUMENTATIONS!!! :(
>>
>> S

[orientdb] Re: [Studio version : 2.0 OrientDB version : 2.0.3] ETL - Importing JSON to OrientDB

2015-03-04 Thread Kiheung Park
I have fixed *ETLPolitician.json* as follow:

{
> "config": {
> "log": "debug"
> },
> "begin": [
> ],
> "source": {
> "file": { "path": "./ETLPolitician.json", "lock": true }
> },
> "extractor": {
> "json": {}
> },
> "transformers": [
> { "document": { "class": "Politician"}}
> ],
> "loader": {
> "orientdb": {
> "dbURL": "plocal:../databases/AgentDatabase_Document",
> "dbUser": "admin",
> "dbPassword": "admin",
> "dbAutoCreate": false,
> "standardElementConstraints":  false,
> "tx": false,
> "batchCommit": 1000,
> "dbType": "document",
> "classes": [{ "name": "Politician", "extends": "Agent" } ],
> "indexes": [{ "class": "Politician", "fields": 
> ["name:string"], "type":"NOTUNIQUE_HASH_INDEX" }]
> }
> }
> }


And now having another error message,


Is ETL only support 'graph' type database? Should I go for graph? 

Best, 

Ki




On Wednesday, March 4, 2015 at 7:06:02 PM UTC-5, Kiheung Park wrote:
>
> Hi,
>
> I want to load JSON formatted data into OrientDB. I have studied all the 
> tutorial materials and sample codes that are provided by orient 
> technologies teams. 
> However, I am having a hard time to figuring what did I do wrong when 
> importing JSON.
>
> I have already designed the document based database called 
> "AgendDatabase_Document" and here is schema of Politician Class:
>
>
> 
> And here is my sample json (input file / *source*):
>
> [{
>> "affiliatedCommittee": [
>> "국회운영위원회",
>> "안전행정위원회"
>> ],
>> "age": 0,
>> "birthPlace": "",
>> "birthday": "6/4/1960",
>> "class": "Politician",
>> "constituency": "경남 창원시성산구",
>> "contact": {
>> "address": null,
>> "class": "Contact",
>> "phoneNumber": null
>> },
>> "education": {
>> "class": "Education",
>> "degreeStatus": null,
>> "department": null,
>> "highschool": "마산공업고등학교",
>> "major": null,
>> "university": null
>> },
>> "experience": {
>> "class": "Experience",
>> "experience": [
>> "경남도의회 의원 (7대, 8대), 새누리당 경남도당 수석부대변인"
>> ]
>> },
>> "gender": true,
>> "group": [
>> "19"
>> ],
>> "military": "",
>> "name": "강기윤",
>> "nationality": "대한민국",
>> "partyName": "새누리당"
>> }]
>
>
>
> And here is my *ETLpolitician.json *on bin directory.
>
>> {
>> "config": {
>> "log": "debug"
>> },
>> "begin": [
>> ],
>> "source": {
>> "file": { "path": "./ETLPolitician.json", "lock": true } //have tried 
>> ETLPolitician.json, but didn't work as well...
>> },
>> "extractor": {
>> "json": {}
>> },
>> "transformers": [
>> { "document": { "class": "Politician"}}
>> ],
>> "loader": {
>> "orientdb": {
>> "dbURL: "plocal:../databases/AgentDatabase_Document",
>> "dbUser": "admin",
>> "dbPassword": "admin",
>> "dbAutoCreate": false,
>> "tx": false,
>> "batchCommit": 1000,
>> "dbType": "document"
>> }
>> },
>> } 
>
>
> When I run *oetl.bat ETLPolitician.json *, I got following error 
> message...
>
>
> 
>  
> Can anyone help me on importing JSON? DEFINITELY NEED MORE 
> DOCUMENTATIONS!!! :(
>
> Sincerely, 
>
> Ki
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Elixir or Erlang libs

2015-03-04 Thread lenz
Hi,

I am pretty new to OrientDB but what I see I like a lot. Is there anyone
here that uses OrientDB from Erlang or Elixir? I would rather help build
and debug an existing approach than rolling my own.

cheers
Lenz

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Vertices and edges size

2015-03-04 Thread Claudio
Hi,
please read https://groups.google.com/d/msg/baasbox/FwD-zFE5CeE/yd69EOdlD-IJ
You posted a similar question to the BaasBox group too.


Il giorno mercoledì 4 marzo 2015 20:22:59 UTC+1, Davide Neri ha scritto:
>
> Ok, I need to review what I wrote cause doing further testing something 
> happened.
> After rebooting the droplet the DB is on, the size dropped to a much 
> better size. Seems like it was cache taking up space.
> Also, every time a new vertex is made the dashboard of BaasBox is 
> reporting that the dimension of the overall database increases of the 5KB+, 
> but the dimension of the collection the vertex increases of only 
> 400Bytes...so of the amount.
>
> After rebooting the "database size" drops but not as much to reach the 
> "collection size" ...each vertex on the "database size" weights around 1KB. 
> And each edge around 0.85KB.
> Are these sizes good or is there still something different from the way 
> OrientDB usually works?
>
> Thank you very much
>
> [d]
>
>
> Il giorno mercoledì 4 marzo 2015 18:41:52 UTC+1, Davide Neri ha scritto:
>>
>> I started to use OrientDB through BaaSBox. I'm making some tests to 
>> quantify the resources I'll need in the future in the project I'm working 
>> on.
>> I realized that, after the creation of 1000 vertices, each one with a 
>> JSON content of around 400 Bytes, the db size increased of 6.5 MB. That 
>> means that each vertices size on the hard disk is 6.5 KB, even if I'm 
>> storing only 400 Bytes of data.
>> Then I tried the same with edges, and after the creation of 1000 edges 
>> the database increased of 10 MB. That means that each edge size on the hard 
>> disk is of 10 KB.
>>
>> Are these data right?
>> Are these the usual sizes for OrientDB vertices and edges, or is the size 
>> due to the way BaaSBox is using it?
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] [Studio version : 2.0 OrientDB version : 2.0.3] ETL - Importing JSON to OrientDB

2015-03-04 Thread Kiheung Park
Hi,

I want to load JSON formatted data into OrientDB. I have studied all the 
tutorial materials and sample codes that are provided by orient 
technologies teams. 
However, I am having a hard time to figuring what did I do wrong when 
importing JSON.

I have already designed the document based database called 
"AgendDatabase_Document" and here is schema of Politician Class:


And here is my sample json (input file / *source*):

[{
> "affiliatedCommittee": [
> "국회운영위원회",
> "안전행정위원회"
> ],
> "age": 0,
> "birthPlace": "",
> "birthday": "6/4/1960",
> "class": "Politician",
> "constituency": "경남 창원시성산구",
> "contact": {
> "address": null,
> "class": "Contact",
> "phoneNumber": null
> },
> "education": {
> "class": "Education",
> "degreeStatus": null,
> "department": null,
> "highschool": "마산공업고등학교",
> "major": null,
> "university": null
> },
> "experience": {
> "class": "Experience",
> "experience": [
> "경남도의회 의원 (7대, 8대), 새누리당 경남도당 수석부대변인"
> ]
> },
> "gender": true,
> "group": [
> "19"
> ],
> "military": "",
> "name": "강기윤",
> "nationality": "대한민국",
> "partyName": "새누리당"
> }]



And here is my *ETLpolitician.json *on bin directory.

> {
> "config": {
> "log": "debug"
> },
> "begin": [
> ],
> "source": {
> "file": { "path": "./ETLPolitician.json", "lock": true } //have tried 
> ETLPolitician.json, but didn't work as well...
> },
> "extractor": {
> "json": {}
> },
> "transformers": [
> { "document": { "class": "Politician"}}
> ],
> "loader": {
> "orientdb": {
> "dbURL: "plocal:../databases/AgentDatabase_Document",
> "dbUser": "admin",
> "dbPassword": "admin",
> "dbAutoCreate": false,
> "tx": false,
> "batchCommit": 1000,
> "dbType": "document"
> }
> },
> } 


When I run *oetl.bat ETLPolitician.json *, I got following error message...


 
Can anyone help me on importing JSON? DEFINITELY NEED MORE 
DOCUMENTATIONS!!! :(

Sincerely, 

Ki

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] compound index seems to be ignored

2015-03-04 Thread Máté Gábri
Hi,

I'm trying to get familiar with OrientDB's indexing to make some 
performance tests. I'm running a query on a class which uses 10+ conditions 
in the WHERE statement with range selections, constants and IN conditions. 
I've created the compound index in the same order as the fields appear in 
the WHERE statement but it seems like the index is ignored. The EXPLAIN 
command shows that the index is used, but the scanned documents number is 
the same as the number of documents in the class. After some 
experimentation I came to the conclusion that with 2 conditions the index 
is "working", so just part of the class is scanned, but after adding the 
third condition the whole class is scanned. I'm just not sure wether this 
is normal behaviour or not. Am I missing something?

Best regards,
Mate

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] NavigableMap type on Relationships

2015-03-04 Thread Simon French
Hi,
I am evaluating OrientDb and it looks great.
I am looking for a facility to order relationships by a property. From what 
I can gather the relationships are ordered by insertion? Is it possible to 
somehow index a 1 to many relationship ?

To give a little context I would like to record a persons weight for 
example, and most of the time I would only be interested in the most recent 
weight. It would make sense therefore to spend time upon insertion rather 
than querying.

Thanks

Simon

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [orientdb] Distributed OrientDB via Multi-host Docker

2015-03-04 Thread Tobie Morgan Hitchcock
Hi Luca,

Docker differences

1. Using `centos:7` not `debian`
2. Using `java-1.7.0-openjdk-headless` instead of `java-1.7.0-openjdk`
3. The OrientDB install tar file 
(https://abcum-deploy.s3.amazonaws.com/orient/orientdb-community-2.0.4.tar.gz) 
is an exact copy of the one available at 
http://www.orientechnologies.com/download/ except that it has had the demo 
database removed to make it smaller.
4. The OrientDB configs are included in the docker image in the /conf/ 
folder, and do not need to be included on a shared volume.
5. The OrientDB config and startup script has been simplified slightly so 
that it runs in the foreground on CoreOS in a distributed setup.
6. Running the docker image will launch a 'ready to go' distributed 
OrientDB instance using either TCP or AWS node discovery.
7. The OrientDB instance is launched in the foreground (not as a daemon) so 
that it can be controlled by Fleet on CoreOS
8. Using Hazelcast variables 
(http://blog.hazelcast.com/2013/08/14/xml-variables/) for putting the 
docker environment variables into the hazelcast.xml file.

If running OrientDB on a CoreOS cluster in Amazon EC2/VPC you should be 
able to launch any number of OrientDB instances which connect with each 
other using the Fleetctl service file, which is included in the repository.

I think those are the main differences off the top of my head!

Tobie

On Wednesday, 4 March 2015 18:24:24 UTC, Lvc@ wrote:
>
> Hi Tobie,
> How your project compares to 
> https://github.com/orientechnologies/orientdb-docker ?
>
>
> Lvc@
>
>
> On 4 March 2015 at 14:41, Tobie Morgan Hitchcock  > wrote:
>
>> Hi Esen,
>>
>> I've just been through the same problem, but have a solution.
>>
>> Basically, Hazelcast attaches itself to the private ip address of the 
>> docker container, and notifies other nodes of this ip address (meaning that 
>> it does not ever match the members). There are two solutions...
>>
>> 1. Use *docker run --net=host* to run the docker container (works ok, 
>> but the container is therefore not running in it's separate network).
>> 2. Pass the private/public IP address of the machine to the docker 
>> container so that Hazelcast knows which IP address to bind to.
>>
>>1. Add >>IPV4ADDRESSHERE into hazelcast.xml
>>2. Add IPV4ADDRESSHERE>network>
>>
>> I've setup a docker container to do exactly this, which can be used to 
>> setup a distributed OrientDB running on CoreOS using Fleet (fleetctl). This 
>> will work on Vagrant or Amazon EC2/VPC.
>>
>> The repository is available here: 
>> https://github.com/abcum/docker-orientdb.git
>>
>> Tobie
>>
>>
>> On Tuesday, 6 January 2015 07:19:42 UTC, Esen Sagynov wrote:
>>>
>>> I can successfully telnet to each server from any other server because 
>>> incoming requests are allowed. In fact, each server successfully receives a 
>>> connection request, however, there seems to be some kind of a validation. 
>>> When the host A receives a connection request from host B, host A checks if 
>>> the requested IP address is host A's IP address. Now here this validation 
>>> fails according to the above error message.
>>>
>>> I wonder if it is necessary to do such validations in ODB?
>>>
>>> On Monday, January 5, 2015 9:27:31 PM UTC+9, Lvc@ wrote:

 Hi Esen,
 Seems OrientDB servers can't see each other. I suggest you to try if 
 connections are allowed between hosts with CURL.

 Lvc@


 On 5 January 2015 at 07:19, Esen Sagynov  wrote:

> Using ODB 2.0-SNAPSHOT (Jan 5, 2015).
>
> My nodes in Docker containers on separate physical machines cannot 
> join to each other. The establish a connection however eventually they 
> refuse joining because some conditions aren't met.
>
> The following are logs on Host 2:
>
> 2015-01-05 06:07:15:691 INFO  [172.17.0.3]:2434 [orientdb] [3.3] 
> Accepting socket connection from /123.123.123.124:55647 [
> SocketAcceptor]
> 2015-01-05 06:07:15:692 INFO  [172.17.0.3]:2434 [orientdb] [3.3] 
> Established socket connection between /172.17.0.3:2434 and /123.123.
> 123.124:55647 [TcpIpConnectionManager]
> 2015-01-05 06:07:15:694 WARNING [172.17.0.3]:2434 [orientdb] [3.3] 
> Wrong bind request from Address[172.17.0.12]:2434! This node is not 
> requested endpoint: Address[123.123.123.124]:2434 [
> TcpIpConnectionManager]
>
> Host 1 (123.123.123.123) running ODB in a container 172.17.0.3:2434.
> Host 2 (123.123.123.124) running ODB in a container 172.17.0.12:2434.
> Host 3 (123.123.123.125) running ODB in a container 172.17.0.10:2434.
>
> Because docker on each host manages its own bridge each ODB container 
> doesn't see it directly. This is why in config/hazelcast.xml I specify 
> the 
> IP of the host machines.
>
> 
>  123.123.123.123:2434
>  123.123.123.124:2434
>  

Re: [orientdb] Re: Record deadlock issue in 2.0.2

2015-03-04 Thread Kareem Jabr
Im using object api not the graph. And it happens when i clear multiple
lists of nested objects, like, match.getGoals.clear then I call
match.getGoals.addAll(newGoalsList)  i see in the errors log orientdb
exception regarding not found records #27.6765 some id. And then the
timeout exception lock. I will post the thread dump when the exception
occurs to get a clear idea about the error.

Thanks
On Mar 2, 2015 11:46 PM, "alexander anguiano"  wrote:

> i also was getting this.   It seems when you do thing using the graphdb it
> cause problems
>
> My queries and updates where like this
>
> select * from groups where @rid = #12:3
>
> I change them to this
>
> select * from #12:3
>
> I had updates like this
>
> update table set mfield = 12 where @rid = #14:4
>
> i changed the to this
>
>
> UPDATE (select expand(in('Target')) from #14:4) set tags = 'mytag'
>
> Also, i don't think you can parameterize that so you have to do this'
>
> UPDATE (select expand(in('Target')) from #%s) set tags = '%s'
>
>
>
> On Thursday, February 19, 2015 at 5:08:59 PM UTC-6, Kareem Jabr wrote:
>>
>> I am facing this exception a lot now,
>>
>> in context with path [/aa-sport] threw exception
>> [com.orientechnologies.orient.core.exception.ODatabaseException: Error
>> on retrieving record #27:165831 (cluster: event)] with root cause
>> com.orientechnologies.common.concur.OTimeoutException: Can not lock
>> record for 2000 ms. seems record is deadlocked by other record
>> at com.orientechnologies.orient.core.storage.impl.local.
>> OAbstractPaginatedStorage.acquireReadLock(OAbstractPaginatedStorage.
>> java:1308)
>> at com.orientechnologies.orient.core.tx.OTransactionAbstract.
>> lockRecord(OTransactionAbstract.java:120)
>> at com.orientechnologies.orient.core.id.ORecordId.lock(
>> ORecordId.java:282)
>> at com.orientechnologies.orient.core.storage.impl.local.
>> OAbstractPaginatedStorage.lockRecord(OAbstractPaginatedStorage.java:1784)
>> at com.orientechnologies.orient.core.storage.impl.local.
>> OAbstractPaginatedStorage.readRecord(OAbstractPaginatedStorage.java:1424)
>> at com.orientechnologies.orient.core.storage.impl.local.
>> OAbstractPaginatedStorage.readRecord(OAbstractPaginatedStorage.java:697)
>> at com.orientechnologies.orient.core.db.document.
>> ODatabaseDocumentTx.executeReadRecord(ODatabaseDocumentTx.java:1572)
>> at com.orientechnologies.orient.core.tx.OTransactionNoTx.
>> loadRecord(OTransactionNoTx.java:80)
>> at com.orientechnologies.orient.core.db.document.
>> ODatabaseDocumentTx.load(ODatabaseDocumentTx.java:1437)
>> at com.orientechnologies.orient.server.network.protocol.
>> binary.ONetworkProtocolBinary.readRecord(ONetworkProtocolBinary.java:
>> 1453)
>> at com.orientechnologies.orient.server.network.protocol.
>> binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:
>> 346)
>> at com.orientechnologies.orient.server.network.protocol.binary.
>> OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract
>> .java:216)
>> at com.orientechnologies.common.thread.OSoftThread.run(
>> OSoftThread.java:65)
>>
>> I have a web app running on tomcat 7.0.59 and 2.0.2 OrientDB.
>>
>> I am initializing the DB once tomcat starts
>> db = getOObjectDatabaseTx();
>> db.setAutomaticSchemaGeneration(true);
>> db.getEntityManager().registerEntityClasses("com.sport.server.model");
>>
>>
>> public OObjectDatabaseTx getOObjectDatabaseTx() {
>> return OObjectDatabasePool.global().acquire(PropertiesManager.
>> getInstance().getProperty(ENDPOINT_URL), PropertiesManager.getInstance(
>> ).getProperty(DB_USERNAME),
>> PropertiesManager.getInstance().getProperty(DB_PASSWORD));
>> }
>>
>> Please help me in this.. And let me know if I am doing something wrong
>> here. I have a scheduler running to update the DB every couple of secs.
>> This exception happens when I try to read from the DB while writing is
>> occurring. I believe..
>>
>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OrientDB" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/orient-database/INf_ennAN7o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> orient-database+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Vertices and edges size

2015-03-04 Thread Davide Neri
Ok, I need to review what I wrote cause doing further testing something 
happened.
After rebooting the droplet the DB is on, the size dropped to a much better 
size. Seems like it was cache taking up space.
Also, every time a new vertex is made the dashboard of BaasBox is reporting 
that the dimension of the overall database increases of the 5KB+, but the 
dimension of the collection the vertex increases of only 400Bytes...so of 
the amount.

After rebooting the "database size" drops but not as much to reach the 
"collection size" ...each vertex on the "database size" weights around 1KB. 
And each edge around 0.85KB.
Are these sizes good or is there still something different from the way 
OrientDB usually works?

Thank you very much

[d]


Il giorno mercoledì 4 marzo 2015 18:41:52 UTC+1, Davide Neri ha scritto:
>
> I started to use OrientDB through BaaSBox. I'm making some tests to 
> quantify the resources I'll need in the future in the project I'm working 
> on.
> I realized that, after the creation of 1000 vertices, each one with a JSON 
> content of around 400 Bytes, the db size increased of 6.5 MB. That means 
> that each vertices size on the hard disk is 6.5 KB, even if I'm storing 
> only 400 Bytes of data.
> Then I tried the same with edges, and after the creation of 1000 edges the 
> database increased of 10 MB. That means that each edge size on the hard 
> disk is of 10 KB.
>
> Are these data right?
> Are these the usual sizes for OrientDB vertices and edges, or is the size 
> due to the way BaaSBox is using it?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: Two-way link in document mode from console in 2.0.3?

2015-03-04 Thread Colin
Hi Sergey.

What you did via the console looks fine.

Try:

select expand(comments) from Post to display a list of the comments.

-Colin

Orient Technologies

The Company behind OrientDB


On Wednesday, March 4, 2015 at 2:44:18 AM UTC-6, Sergey Dashko wrote:
>
> Hello.
> Trying to link two classes like this:
> create class Post
> create class Comment
> create property Post.title string
> create property Comment.title string
> create property Post.comments LINKSET Comment
> create property Comment.post Link Post
>  insert into Comment content {title: 'Comment1'}
>
> Inserted record 'Comment#17:0{title:Comment1} v1' in 0.005000 sec(s).
>
> insert into Post content {title: 'Post1'}
>
> Inserted record 'Post#16:0{title:Post1} v1' in 0.002000 sec(s).
>
> Now linking:
> update #17:0 SET post=#16:0
> update #16:0 ADD comments=#17:0
>
> Result:
> select from Comment
> +-+---++-
> #   |@RID |@CLASS |title   |post
> +-+---++-
> 0   |#17:0|Comment|Comment1|#16:0
>
>
> select from Post
> +-+--+-+
> #   |@RID |@CLASS|title|comments
> +-+--+-+
> 0   |#16:0|Post  |Post1|[1]
>
> Now questions. 
> 1) If what I'm doing is correct way to build two-way linking for documents?
> 2) If yes, how can I retrieve list of comments for post?
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [orientdb] Distributed OrientDB via Multi-host Docker

2015-03-04 Thread Luca Garulli
Hi Tobie,
How your project compares to
https://github.com/orientechnologies/orientdb-docker ?


Lvc@


On 4 March 2015 at 14:41, Tobie Morgan Hitchcock  wrote:

> Hi Esen,
>
> I've just been through the same problem, but have a solution.
>
> Basically, Hazelcast attaches itself to the private ip address of the
> docker container, and notifies other nodes of this ip address (meaning that
> it does not ever match the members). There are two solutions...
>
> 1. Use *docker run --net=host* to run the docker container (works ok, but
> the container is therefore not running in it's separate network).
> 2. Pass the private/public IP address of the machine to the docker
> container so that Hazelcast knows which IP address to bind to.
>
>1. Add >IPV4ADDRESSHERE into hazelcast.xml
>2. Add IPV4ADDRESSHEREnetwork>
>
> I've setup a docker container to do exactly this, which can be used to
> setup a distributed OrientDB running on CoreOS using Fleet (fleetctl). This
> will work on Vagrant or Amazon EC2/VPC.
>
> The repository is available here:
> https://github.com/abcum/docker-orientdb.git
>
> Tobie
>
>
> On Tuesday, 6 January 2015 07:19:42 UTC, Esen Sagynov wrote:
>>
>> I can successfully telnet to each server from any other server because
>> incoming requests are allowed. In fact, each server successfully receives a
>> connection request, however, there seems to be some kind of a validation.
>> When the host A receives a connection request from host B, host A checks if
>> the requested IP address is host A's IP address. Now here this validation
>> fails according to the above error message.
>>
>> I wonder if it is necessary to do such validations in ODB?
>>
>> On Monday, January 5, 2015 9:27:31 PM UTC+9, Lvc@ wrote:
>>>
>>> Hi Esen,
>>> Seems OrientDB servers can't see each other. I suggest you to try if
>>> connections are allowed between hosts with CURL.
>>>
>>> Lvc@
>>>
>>>
>>> On 5 January 2015 at 07:19, Esen Sagynov  wrote:
>>>
 Using ODB 2.0-SNAPSHOT (Jan 5, 2015).

 My nodes in Docker containers on separate physical machines cannot join
 to each other. The establish a connection however eventually they refuse
 joining because some conditions aren't met.

 The following are logs on Host 2:

 2015-01-05 06:07:15:691 INFO  [172.17.0.3]:2434 [orientdb] [3.3]
 Accepting socket connection from /123.123.123.124:55647 [SocketAcceptor
 ]
 2015-01-05 06:07:15:692 INFO  [172.17.0.3]:2434 [orientdb] [3.3]
 Established socket connection between /172.17.0.3:2434 and /123.123.
 123.124:55647 [TcpIpConnectionManager]
 2015-01-05 06:07:15:694 WARNING [172.17.0.3]:2434 [orientdb] [3.3]
 Wrong bind request from Address[172.17.0.12]:2434! This node is not
 requested endpoint: Address[123.123.123.124]:2434 [
 TcpIpConnectionManager]

 Host 1 (123.123.123.123) running ODB in a container 172.17.0.3:2434.
 Host 2 (123.123.123.124) running ODB in a container 172.17.0.12:2434.
 Host 3 (123.123.123.125) running ODB in a container 172.17.0.10:2434.

 Because docker on each host manages its own bridge each ODB container
 doesn't see it directly. This is why in config/hazelcast.xml I specify the
 IP of the host machines.

 
  123.123.123.123:2434
  123.123.123.124:2434
  123.123.123.125:2434
 

 All ODB containers expose all 3 ports (2424, 2480, 2434). I can telnet
 and ping. However, because each container requests a dynamic docker IP
 address, each node cannot join the same cluster because host IP doesn't not
 match the actual Docker IP inside the container as shown in the above error
 log.

 Any solutions for this?

 --

 ---
 You received this message because you are subscribed to the Google
 Groups "OrientDB" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to orient-databa...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to orient-database+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Vertices and edges size

2015-03-04 Thread Davide Neri
I started to use OrientDB through BaaSBox. I'm making some tests to 
quantify the resources I'll need in the future in the project I'm working 
on.
I realized that, after the creation of 1000 vertices, each one with a JSON 
content of around 400 Bytes, the db size increased of 6.5 MB. That means 
that each vertices size on the hard disk is 6.5 KB, even if I'm storing 
only 400 Bytes of data.
Then I tried the same with edges, and after the creation of 1000 edges the 
database increased of 10 MB. That means that each edge size on the hard 
disk is of 10 KB.

Are these data right?
Are these the usual sizes for OrientDB vertices and edges, or is the size 
due to the way BaaSBox is using it?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Possibile bug in OIndexFullText, please help me reproducing it

2015-03-04 Thread Riccardo Tasso
Hi, I've found something very strange with automatic entry insertion inside 
a FULLTEXT index ( OIndexFullText ).
The bug is with plocal engine and both with Orient 1.7.10 and 2.0.4.

I know your focus is on lucene indices now, but I can't migrate to lucene 
in my application right now. Anyway I think that FULLTEXT index are simple 
and useful in some cases.

I have a hierarchy of classes with properties, some of them are:
CREATE PROPERTY V.title STRING;
[...]
CREATE CLASS Generated EXTENDS V;
[...]
CREATE CLASS Media EXTENDS Generated;
[...]
*CREATE CLASS Contribution EXTENDS Media;*


I have a index on V, created right after schema creation and before data 
insertion:
CREATE INDEX V-label-fulltext ON V (label) FULLTEXT METADATA { indexRadix : 
false }

After this phase I start inserting some vertices and edges.

The bug is as follows (I will explain with OSQL but insertion is done by 
API within my app):
// step 1
INSERT INTO Contribution(title) VALUES("alfa beta");
SELECT FROM Contribution WHERE title containsText 'alfa'
// returns correctly one result

// step 2
INSERT INTO Contribution(title) VALUES("gamma delta");
SELECT FROM Contribution WHERE title containsText 'gamma'
// returns correctly one result

// step 3
INSERT INTO Contribution(title) VALUES("alfa iota");
SELECT FROM Contribution WHERE title containsText 'alfa'
// FAILS >> returns only one result, the same of step 1

Also closing my application and connecting to database from Orient Console 
I can see that inside my index there is only one entry for key "alfa".
After a rebuild of all indices all of the entries are indexed as expected.

As usual I tried to reproduce the error in a simple Unit Test to help you 
discover the bug but there is something missing. Inside the simple world of 
Unit Test the bug is not present.

Can you help me discover what's happening?

Cheers,
   Riccardo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Inserting an index in distributed mode of orientdb throws ODistributedException

2015-03-04 Thread Rinky Mangal
I am having a distributed setup of three nodes.

I am trying to insert an index by below query:
insert into index:dictionary (key, rid) values ('mykey', #ssd);
(via orientdb-2.0.3 release)

but getting  Quorum 3 not reached for request.

*stacktrace:*

orientdb {db=GratefulDeadConcerts}> insert into index:dictionary (key, rid) 
values ('mykey', #ssd);

Error: 
com.orientechnologies.orient.server.distributed.ODistributedException: 
Quorum 3 not reached for request (id=29 from=node3 task=command_sql(insert 
into index:dictionary (key, rid) values ('mykey', #ssd)) userName=). 
Timeout=20ms Servers in timeout/conflict are:
 - node1: 
com.orientechnologies.orient.core.exception.OCommandExecutionException: 
Error on execution of command: sql.insert into index:dictionary (key, rid) 
values ('mykey', #ssd)
 - node2: 
com.orientechnologies.orient.core.exception.OCommandExecutionException: 
Error on execution of command: sql.insert into index:dictionary (key, rid) 
values ('mykey', #ssd)
Received: 
{node1=com.orientechnologies.orient.core.exception.OCommandExecutionException: 
Error on execution of command: sql.insert into index:dictionary (key, rid) 
values ('mykey', #ssd), 
node2=com.orientechnologies.orient.core.exception.OCommandExecutionException: 
Error on execution of command: sql.insert into index:dictionary (key, rid) 
values ('mykey', #ssd), 
node3=com.orientechnologies.orient.core.exception.OCommandExecutionException: 
Error on execution of command: sql.insert into index:dictionary (key, rid) 
values ('mykey', #ssd)}

Can any one help me please ?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [orientdb] Distributed OrientDB via Multi-host Docker

2015-03-04 Thread Tobie Morgan Hitchcock
Hi Esen,

I've just been through the same problem, but have a solution.

Basically, Hazelcast attaches itself to the private ip address of the 
docker container, and notifies other nodes of this ip address (meaning that 
it does not ever match the members). There are two solutions...

1. Use *docker run --net=host* to run the docker container (works ok, but 
the container is therefore not running in it's separate network).
2. Pass the private/public IP address of the machine to the docker 
container so that Hazelcast knows which IP address to bind to.

   1. Add IPV4ADDRESSHERE into hazelcast.xml
   2. Add IPV4ADDRESSHERE

I've setup a docker container to do exactly this, which can be used to 
setup a distributed OrientDB running on CoreOS using Fleet (fleetctl). This 
will work on Vagrant or Amazon EC2/VPC.

The repository is available 
here: https://github.com/abcum/docker-orientdb.git

Tobie


On Tuesday, 6 January 2015 07:19:42 UTC, Esen Sagynov wrote:
>
> I can successfully telnet to each server from any other server because 
> incoming requests are allowed. In fact, each server successfully receives a 
> connection request, however, there seems to be some kind of a validation. 
> When the host A receives a connection request from host B, host A checks if 
> the requested IP address is host A's IP address. Now here this validation 
> fails according to the above error message.
>
> I wonder if it is necessary to do such validations in ODB?
>
> On Monday, January 5, 2015 9:27:31 PM UTC+9, Lvc@ wrote:
>>
>> Hi Esen,
>> Seems OrientDB servers can't see each other. I suggest you to try if 
>> connections are allowed between hosts with CURL.
>>
>> Lvc@
>>
>>
>> On 5 January 2015 at 07:19, Esen Sagynov  wrote:
>>
>>> Using ODB 2.0-SNAPSHOT (Jan 5, 2015).
>>>
>>> My nodes in Docker containers on separate physical machines cannot join 
>>> to each other. The establish a connection however eventually they refuse 
>>> joining because some conditions aren't met.
>>>
>>> The following are logs on Host 2:
>>>
>>> 2015-01-05 06:07:15:691 INFO  [172.17.0.3]:2434 [orientdb] [3.3] 
>>> Accepting socket connection from /123.123.123.124:55647 [SocketAcceptor]
>>> 2015-01-05 06:07:15:692 INFO  [172.17.0.3]:2434 [orientdb] [3.3] 
>>> Established socket connection between /172.17.0.3:2434 and /123.123.
>>> 123.124:55647 [TcpIpConnectionManager]
>>> 2015-01-05 06:07:15:694 WARNING [172.17.0.3]:2434 [orientdb] [3.3] Wrong 
>>> bind request from Address[172.17.0.12]:2434! This node is not requested 
>>> endpoint: Address[123.123.123.124]:2434 [TcpIpConnectionManager]
>>>
>>> Host 1 (123.123.123.123) running ODB in a container 172.17.0.3:2434.
>>> Host 2 (123.123.123.124) running ODB in a container 172.17.0.12:2434.
>>> Host 3 (123.123.123.125) running ODB in a container 172.17.0.10:2434.
>>>
>>> Because docker on each host manages its own bridge each ODB container 
>>> doesn't see it directly. This is why in config/hazelcast.xml I specify the 
>>> IP of the host machines.
>>>
>>> 
>>>  123.123.123.123:2434
>>>  123.123.123.124:2434
>>>  123.123.123.125:2434
>>> 
>>>
>>> All ODB containers expose all 3 ports (2424, 2480, 2434). I can telnet 
>>> and ping. However, because each container requests a dynamic docker IP 
>>> address, each node cannot join the same cluster because host IP doesn't not 
>>> match the actual Docker IP inside the container as shown in the above error 
>>> log.
>>>
>>> Any solutions for this?
>>>
>>> -- 
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "OrientDB" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to orient-databa...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] EXPLAIN gives odd results with sub query

2015-03-04 Thread Jamie Blair
Given the query

EXPLAIN select from (select from Vertex) LIMIT 1

I get the results

elapsed: 2514.5999
recordReads: 1
documentReads: 1
resultSize: 1
evaluated: 1

Given the query took 2.5seconds I would have expected some of those numbers 
to be a lot higher (recordReads, documentReads, resultSize, evaluated)

Anyone any idea whats going on? Given the issues with the query 
parser/optimiser I really need some data about whats going on with my 
queries before they hit production.

Thanks,
Jamie

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [orientdb] getting inconsistent behaviour

2015-03-04 Thread Andrey Lomakin
Hi,

Cool ).

On Wed, Mar 4, 2015 at 1:42 AM, Aris Alexis  wrote:

> Hi,
>
> I have found the problem. I am caching the Vertex object of the user into
> the session, and even though i always commit somehow it doesn't sync well
> in this scenario. If I look up the vertex before running the query to get
> the updated list of friends , it works fine.
>
> On Tuesday, February 17, 2015 at 9:39:27 AM UTC+1, Andrey Lomakin wrote:
>>
>> HI,
>> You always commit tx even in case of rollback (you put commit in finally
>> block), but still it is strange.
>> Could you provide test case which we may run and reproduce this issue ?
>>
>> On Mon, Feb 16, 2015 at 12:58 PM, Aris Alexis 
>> wrote:
>>
>>> Hi, I just started porting my app in orient and some things that were
>>> working need some debugging, I am a bit lost in this one.
>>>
>>> So I have a singleton :
>>>
>>> public class OrientDatabase implements IGraphDatabase {
>>>
>>> private static OrientGraphFactory factory;
>>> private static OrientDatabase instance;
>>> private static String configuration;
>>>
>>>
>>> public static void setConf(String conf) {
>>> configuration=conf;
>>> }
>>> public OrientGraphFactory getFactory() {
>>> return factory;
>>> }
>>>
>>> public OrientDatabase(String conf) {
>>> factory=new OrientGraphFactory(conf);
>>> }
>>>
>>> public static OrientDatabase getInstance() {
>>> if (instance==null) {
>>> return new OrientDatabase(configuration);
>>> }
>>> else {
>>> return instance;
>>> }
>>> }
>>>
>>> @Override
>>> public TransactionalGraph getGraph() {
>>> return this.getFactory().getTx();
>>> }
>>> }
>>>
>>>
>>> then at the start of the Jersey thread :
>>>
>>> TransactionalGraph g= GraphDatabaseFactory.getGraphDatabase().getGraph();
>>>
>>>
>>> I am doing an integration test which does the following: I have a user
>>> with two friends (with edges). I delete one of them. I readd him. I get the
>>> friends list.
>>> these three actions are three different threads but are run sequentially.
>>>
>>> now the following code :
>>>
>>> Iterator vertexIterator= vuser.getVertices(Direction.BOTH, 
>>> GraphHelper.EDGE_TYPE_FRIENDSHIP).iterator();
>>>
>>>
>>> contains 1 entry. Select * from friends shows two edges to the correct
>>> friends.
>>>
>>> from the gremlin console: g.V("username","arisalexis").
>>> both("Friendship")
>>>
>>> I get shown both friends.
>>>
>>> In the end of my functions I always have:
>>>
>>> } catch (Exception e) {
>>> g.rollback();
>>> throw e;
>>> } finally {
>>> g.commit();
>>> }
>>>
>>>
>>> any ideas?
>>>
>>> windows 7, java 8,orient 2.0.2
>>>
>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "OrientDB" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to orient-databa...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Best regards,
>> Andrey Lomakin.
>>
>>   --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to orient-database+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Best regards,
Andrey Lomakin.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Two-way link in document mode from console in 2.0.3?

2015-03-04 Thread Sergey Dashko
Hello.
Trying to link two classes like this:
create class Post
create class Comment
create property Post.title string
create property Comment.title string
create property Post.comments LINKSET Comment
create property Comment.post Link Post
 insert into Comment content {title: 'Comment1'}

Inserted record 'Comment#17:0{title:Comment1} v1' in 0.005000 sec(s).

insert into Post content {title: 'Post1'}

Inserted record 'Post#16:0{title:Post1} v1' in 0.002000 sec(s).

Now linking:
update #17:0 SET post=#16:0
update #16:0 ADD comments=#17:0

Result:
select from Comment
+-+---++-
#   |@RID |@CLASS |title   |post
+-+---++-
0   |#17:0|Comment|Comment1|#16:0


select from Post
+-+--+-+
#   |@RID |@CLASS|title|comments
+-+--+-+
0   |#16:0|Post  |Post1|[1]

Now questions. 
1) If what I'm doing is correct way to build two-way linking for documents?
2) If yes, how can I retrieve list of comments for post?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[orientdb] Re: OrientDB Community 2.0.3 - Losing connection to a remote database

2015-03-04 Thread Ivan Jovanovic
By trying to dissect the problem and see what is causing it I was trying 
different things. 

My application, after each writing of a document, it reads from the 
database to extract the document information and their counts. If I turn 
off this reading the document information everything works just like fine.

The relevant code:

private DocumentCounts extractDocumentCounts(String guid, String taxYear, 
String[] categories) {
int allDocuments = 0;
Map categoryDocuments = new HashMap();
 try {
for(int i = 0; i < categories.length; i++) {
StringBuilder builder = new StringBuilder();
builder.append("SELECT COUNT(*) FROM ");
builder.append(DOCUMENT_CLASS);
builder.append(" WHERE guid='");
builder.append(guid);
builder.append("' AND fiscalyear='");
builder.append(taxYear);
builder.append("' AND category LIKE '%");
builder.append(categories[i]);
builder.append("%'");
 List resultList = factory.getDatabase().command(new 
OCommandSQL(builder.toString())).execute();
Long result = resultList.get(0).field("COUNT");
categoryDocuments.put(categories[i], result.intValue()); 
}

StringBuilder builder = new StringBuilder();
builder.append("SELECT COUNT(*) FROM ");
builder.append(DOCUMENT_CLASS);
builder.append(" WHERE guid='");
builder.append(guid);
builder.append("' AND fiscalyear='");
builder.append(taxYear);
builder.append("'");
 List resultList = factory.getDatabase().command(new 
OCommandSQL(builder.toString())).execute();
Long result = resultList.get(0).field("COUNT");
allDocuments = result.intValue();
}
catch(Exception e) {
e.printStackTrace();
}

return new DocumentCounts(allDocuments, categoryDocuments);
}

So, somehow, this reading from a database right after something has been 
written somehow causes this problem (that I am unable to solve).

Anybody has any idea how can I solve this?

Thanks,
Ivan

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.