[orientdb] Re: OrientGraph Transaction Propagation

2016-03-10 Thread Jan Plaček
"Does OrientGraphFactory.getTx() will return the same OrientGraph instance for current thread" Yes, because it's using OPartitionedDatabasePool However, be careful about two gotchas: 1) By

[orientdb] Re: gremlin and inheritance

2016-01-26 Thread Jan Plaček
Tinkerpop 2 does not define something like classes, so only way to filter verticies is by property or edge. Since Tinkerpop 3 (not implemented by OrientDB yet) verticies are allowed to have a single immutable label accessible via "T.label" . But it's basically used just as typed property name:

[orientdb] Re: gremlin and inheritance

2016-01-26 Thread Jan Plaček
uced to using mixed concepts of SELECT > expand(gremlin("current.)) from A which is less than ideal. > > > On Tuesday, January 26, 2016 at 10:46:42 AM UTC-5, Jan Plaček wrote: >> >> Tinkerpop 2 does not define something like classes, so only way to filter >

[orientdb] Re: OrientGraphFactory Pool vs Network Connection Pool

2015-11-17 Thread Jan Plaček
OrientGraphFactory uses OPartitionedDatabasePool (the connection is unique per DB instance, but you will always get the same DB instance for the same thread, because DB instances are not thread safe):

[orientdb] Re: OrientGraph connection parameters to a multiple remote replicas

2015-11-07 Thread Jan Plaček
You can separate hosts/addresses toby using semicolon (;). Example: remote:server1:2424;server2:;server3 Dne úterý 27. října 2015 15:56:39 UTC+1 Anirudha Jadhav napsal(a): > > Hello All, > > How do i supply the connection strings to OrientGraph Java api to connect > to multiple replicas for

Re: [orientdb] Prepared Statement with params

2015-10-18 Thread Jan Plaček
params.put("vertexparam", new ORecordId("12:0"); Dne čtvrtek 15. října 2015 17:41:35 UTC+2 Simon White napsal(a): > > Looks like my string ORID representation is incorrect but I have no idea > what it should be... is this documented? > -- --- You received this message because you are

Re: [orientdb] Best way to host many orient databases

2015-10-18 Thread Jan Plaček
Doesn't it already in a way of classes and clusters? Dne sobota 17. října 2015 10:59:41 UTC+2 scott molinari napsal(a): > > Would OrientDB also support graph partitioning in some way, like TitanDB > offers, through Tinkerpop's Blueprint PartitionGraph? > >

Re: [orientdb] Best way to host many orient databases

2015-10-18 Thread Jan Plaček
I didn't say it should be used as a solution for multitenancy. I am just saying it can be used the same way as Tinkerpop's PartitionGraph. The thing is, one shouldn't partition any GRAPH database, because it's basically impossible from the nature of graph (well it's possible but one woudn't

[orientdb] Re: Traversal with Edge Properties

2015-10-05 Thread Jan Plaček
If I am not mistaken that would return all verticies of class Class having at least one incoming or outgoing edge with r=true. However that would also include Verticies which are not (transitively) connected between themselfs and it also doesn't take into account edge orientation. I would

[orientdb] Re: Traversal with Edge Properties

2015-10-05 Thread Jan Plaček
I think I found out how to do that: select from ( traverse out_permissions, in from A while ((@class = 'permission' AND r = true) OR @class <> 'permission') ) where @class <> 'permission' The idea is to traverse both verticies and edges. Then check r property only on edge. And finally

[orientdb] ODatabaseListener.onCorruptionRepairDatabase return value

2015-10-04 Thread Jan Plaček
I am implementing simple logging ODatabaseListener, but I am not sure about return value of onCorruptionRepairDatabase. What should be the default? I checked the following example, which returns false:

Re: [orientdb] different query behavior when using Java API vs using Studio - oDB v2.1.0

2015-10-03 Thread Jan Plaček
They way how passed (named/positional) paramaters are represented in a resulting SQL command is determined by a parameter's type. If the parameter's type is String than it ends up in query as string wrapped in quotation marks. So for example String: 11:0 passed as parameter will end up in query

[orientdb] Re: Transaction Propagation with OrientGraph

2015-09-30 Thread Jan Plaček
own() to > return it to the pool. It seems that that g.shutdown() commits all > transaction. > > Tai > > On Wednesday, September 30, 2015 at 1:52:36 PM UTC-4, Jan Plaček wrote: >> >> You have to start each transaction even the nested ones ... when you >> start a

[orientdb] Re: Transaction Propagation with OrientGraph

2015-09-30 Thread Jan Plaček
mp out that number in each my delete method. It turns > out this number is always 0. What does that mean? I only called begin() > once in the top level method never called it again in each delete method. > > Thanks, > > Tai > > On Wednesday, September 30, 2015 at 12:15

[orientdb] Re: Transaction Propagation with OrientGraph

2015-09-30 Thread Jan Plaček
ing me to the right direction. I fixed this issue by > calling g.shutdown(false, false) in all my lookup methods. Then it won't > commit the transaction. > > On Wednesday, September 30, 2015 at 2:37:39 PM UTC-4, Jan Plaček wrote: >> >> Yes, shutdown commits transaction, the

[orientdb] Using level ranges or asterisk in SQL fetchplan results in OCommandSQLParsingException

2015-09-30 Thread Jan Plaček
Using asterisk or minus character in level specifier produces OCommandSQLParsingException (orientdb 2.1.1) Fetch plan examples producing exception: fetchplan [0-3]property:-1 fetchplan [-3]property:-1 fetchplan [3-]property:-1 fetchplan [*]property:-1 -- --- You received this message

[orientdb] Re: Transaction Propagation with OrientGraph

2015-09-30 Thread Jan Plaček
Try to dump following in your methods: graph.getRawGraph().getTransaction().amountOfNestedTxs(); I checked the tx implementation, and commit is not triggered when this number is not 0:

Re: [orientdb] Transaction Propagation with OrientGraph

2015-09-30 Thread Jan Plaček
You may also try to manage transaction on underlying ODatabaseDocumentTx: graph.getRawGraph().begin(); graph.getRawGraph().commit(); graph.getRawGraph().rollback(); However if tx propagation does not work you should raise an issue, because it should work according to documentation.

[orientdb] Fetch plan - inability to exlude property from eager fetch

2015-09-29 Thread Jan Plaček
I think there is a flaw in fetch plan design (or implementation), the problem is that these two following fetch plans return the same result: ridCollection:0 ridCollection:1 In both cases IDs contained in these collections will be expanded into actual records (they're eagerly fetched) and any

[orientdb] Re: Does fetch plan actually have any effect when working with OrientVertex/ODocument in remote mode?

2015-09-25 Thread Jan Plaček
#11:0")); Dne středa 23. září 2015 23:52:13 UTC+2 Jan Plaček napsal(a): > > Consider tree like graph represented by "Node" verticies and "childOf" > edges (oriented from child to parent) and command: > > Iterable roots = (Iterable) graph.command(new >

[orientdb] Does fetch plan actually have any effect when working with OrientVertex/ODocument in remote mode?

2015-09-23 Thread Jan Plaček
Consider tree like graph represented by "Node" verticies and "childOf" edges (oriented from child to parent) and command: Iterable roots = (Iterable) graph.command(new OCommandSQL("select from Node where key = 'root' fetchplan in_childOf:-1")).execute(); Now when I traverse the tree by

[orientdb] Re: pooled connection factory for documents - oDB 2.1.2

2015-09-18 Thread Jan Plaček
Maybe there is an alternative but you can get ODatabaseDocumentTx also from OrientGraphFactory: OrientGraphFactory graphFactory = new OrientGraphFactory(url, dbUser, dbPsw); graphFactory.setupPool(1, 10); graphFactory.getDatabase(); // ODatabaseDocumentTx graphFactory.getTx(); //

[orientdb] Re: Add Multiple IDs in a Transaction to a LinkSet

2015-09-15 Thread Jan Plaček
Shouldn't the $ character be also in var declaration (let $doorOne = )? Dne úterý 15. září 2015 16:59:41 UTC+2 Jonas Laux napsal(a): > > I'm trying to add IDs from a inserted column to another inserted column in > a Transaction. I tried like this: > > begin > let doorOne = INSERT INTO doors

[orientdb] Re: Concurrent reads on single transaction?

2015-09-15 Thread Jan Plaček
Actually by default OrientDB uses READ COMMITED isolation level and it's only available option for remote mode. REPEATABLE READS can be used with memory or plocal modes, with a price of higher memory consumption. You stated that there won't be any writes on that Graph instance, therefore TXs

[orientdb] Re: Concurrent reads on single transaction?

2015-09-15 Thread Jan Plaček
http://orientdb.com/docs/2.1/Transactions.html Check the isolation part. I might not be precise about "reads". The COMMANDS are executed out of TX scope. The point is that when a record is "fetched" from DB you will get lastly commited version of that record, every time this "fetch" is

Re: [orientdb] Re: MBean for read cache cannot be registered

2015-09-15 Thread Jan Plaček
; > On Tue, Sep 15, 2015 at 3:14 AM Jan Plaček <j.pl...@centrum.cz > > wrote: > >> I also get this exception when shutting down the WildFly server: >> >> 02:09:25,998 INFO [com.orientechnologies.orient.core.Orient] >> (Thread-1

[orientdb] Re: How to create vertex with label using Gremlin in Studio?

2015-09-14 Thread Jan Plaček
Vertex labels are part of Tinkerpop 3, while OrientDB supports only Tinkerpop 2 so far... Dne pondělí 14. září 2015 16:09:13 UTC+2 Valery T napsal(a): > > I am trying to create a vertex with label using generic (not > OrientDb-specific) Gremlin syntax: > > g.addVertex(T.label, "State") > >

[orientdb] Re: How can I run multiple Gremlin statements in OrientDb?

2015-09-14 Thread Jan Plaček
It' about creating a pipe or compiling a query/statement into a pipe and passing graph instance to that pipe. You can also run scripts containing queries via interpreter. Detailed info here: https://github.com/tinkerpop/gremlin/wiki/Using-Gremlin-through-Java Dne pondělí 14. září 2015 16:53:36

[orientdb] Re: How do I create an edge with class in Gremlin?

2015-09-14 Thread Jan Plaček
Edge label is automatically considered as edge's class you shoudn't prepend "class:" g.addEdge(v1, v2, "Child") Dne pondělí 14. září 2015 15:30:59 UTC+2 Valery T napsal(a): > > The following Gremlin code produces an error in Studio: > g.addEdge(v1, v2, "class:Child") > > -- --- You received

[orientdb] Re: The graph view does not refresh

2015-09-14 Thread Jan Plaček
If you're refering Graph view in Studio, it unfortunatelly works only "additively". Use Clear Canvas button and run select query again, then you will see the changes. Dne pondělí 14. září 2015 13:42:23 UTC+2 Sam Rose napsal(a): > > I created edge 'responsible' between vertex 'users' and

[orientdb] Re: MBean for read cache cannot be registered

2015-09-14 Thread Jan Plaček
) at com.orientechnologies.orient.core.storage.cache.local.O2QCache.unregisterMBean(O2QCache.java:544) [orientdb-core-2.1.1.jar:2.1.1] ... 3 more Dne sobota 12. září 2015 18:06:46 UTC+2 Jan Plaček napsal(a): > > When I redeploy an aplication on WildFly 8.2.0 (standalone full profile) I > get following exception. > It happens only on the first creatio

Re: [orientdb] Re: How can I run multiple Gremlin statements in OrientDb?

2015-09-14 Thread Jan Plaček
s shipped with the OrientDb Enterprise 2.1.0. > > On Mon, Sep 14, 2015 at 4:17 PM, Jan Plaček <j.pl...@centrum.cz > > wrote: > >> I think you actually want to run a script which uses Gremlin API, afaik >> it's not possible with Studio. >> The Studio does not work

[orientdb] Re: What's the most efficient way to update LINK MAP using Java API?

2015-09-14 Thread Jan Plaček
eath anyway. > > This is one of my least favourite aspects of OrientDB. The whole > multi-model thing is great in theory but there are too many ways of one > model bleeding into another. When I'm working with a graph database, I > don't want to have to deal with the document part

[orientdb] Re: How can I run multiple Gremlin statements in OrientDb?

2015-09-14 Thread Jan Plaček
nguages offers, like optional parenthesis, closures, metaprogramming and so on. Dne pondělí 14. září 2015 17:23:23 UTC+2 Valery T napsal(a): > > I would like to run them from a console or Studio, not from Java code. > > On Monday, September 14, 2015 at 11:09:25 AM UTC-4, Jan Plaček

[orientdb] Re: What's the most efficient way to update LINK MAP using Java API?

2015-09-14 Thread Jan Plaček
> a way to do this using just the graph API but this will do for now. > > A small issue with your code: the Vertex class doesn't have a getRecord() > method. You have to cast it to an OrientVertex. > > Curtis > > On Monday, September 14, 2015 at 12:21:12 PM UTC-

[orientdb] Re: What's the most efficient way to update LINK MAP using Java API?

2015-09-14 Thread Jan Plaček
AFAIK the LINK MAP is stored like this { "key1":"#x:y", "key2":"#y:z"} So I assume that adding/removing entries involves only a change of the record which owns this map. On the other hand changes on linked records (entries) involve only changed mapped records (the map itself is intact). Be aware

[orientdb] Re: Concurrent reads on single transaction?

2015-09-13 Thread Jan Plaček
I am a newbie so I unfortuantelly can't answer your question, but I would like to ask why do you have to perform reads in a transaction? Do you use REPEATABLE READS isolation level? Dne středa 2. září 2015 9:59:00 UTC+2 Alan47 napsal(a): > > Hello everyone, > > > *Detailed explanation of the

[orientdb] MBean for read cache cannot be registered

2015-09-12 Thread Jan Plaček
When I redeploy an aplication on WildFly 8.2.0 (standalone full profile) I get following exception. It happens only on the first creation of (remote) graph instance after redeploy, additional requests (I am using OrientGraphFactory) for graph instance don't produce the exception. I also haven't

[orientdb] Re: SELECT * for properties only?? No in/out lists.

2015-09-10 Thread Jan Plaček
Try to use fetch plan: http://orientdb.com/docs/2.1/Fetching-Strategies.html You can find example there: - "[*]in_*:-2 out_*:-2": returns all the properties, but edges (at any level) Dne pondělí 7. září 2015 22:41:37 UTC+2 MV-dev1 napsal(a): > > > > *>> Is it possible or is there a

[orientdb] Re: SQL collect path in tree

2015-09-10 Thread Jan Plaček
Definitely useful, thank you. I see you create and execute SQL query in each iteration, I can imagine there might be some overhead caused by parsing and transforming that query into some native api calls? I don't have any need for that currently, but I wonder if there is some lower level api

[orientdb] Re: SELECT * for properties only?? No in/out lists.

2015-09-10 Thread Jan Plaček
Hm, I thought that the fetch plan will completely omit in_* and out_* properties, but it just prevent "hydration" of those edges itself I guess? Good to know about exclude method, unfortunately it doesn't support wildcard chars or does it? Dne čtvrtek 10. září 2015 22:48:04 UTC+2 MV-dev1

[orientdb] Re: Is opening a database connection an expensive operation?

2015-09-09 Thread Jan Plaček
For pooling use OrientGraphFactory: http://orientdb.com/docs/last/Graph-Factory.html However the database instance is bound to thread. For a single thread the factory always returns the same database instance, no matter how many times you request a database instance from this thread. If you

[orientdb] Re: Best practice for Edges with same names

2015-09-08 Thread Jan Plaček
Your VENUEROLE, PROJECTROLE, COMPANYROLE edges can subclass ROLE edge, so you can traverse specific role or all roles. I also use module based prefixes to prevent name clashes: Authentication_Role, Company_Role ... Dne úterý 8. září 2015 17:39:48 UTC+2 Scott Wruble napsal(a): > > Just learning

[orientdb] SQL collect path in tree

2015-09-08 Thread Jan Plaček
I've got a tree where each node (vertex of class Scope) has property "key" and nodes are connected to it's parent by "childOf" edge (edge is directed from child to parent). I need a query which would traverse a tree from a known root and create a path to each node by concatenating "key"