Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer 47: Vertex Creation and Retrieval Fails in 2014-03-17 1.7-RC2-SNAPSHOT #2134

Closed
j5bot opened this issue Mar 17, 2014 · 41 comments
Closed
Assignees
Milestone

Comments

@j5bot
Copy link

j5bot commented Mar 17, 2014

I don't have a clean code repro case to give you but I will try to give you the code unwound from our abstractions:

...
public createObject() {
FramedObject object = framedGraph.addVertex("class:FramedObject");
object.setSomeProperty(someValue);
return object;
}
...
public FramedObject insertObject() {
FramedObject object = createObject();
...
object.setSomeOtherProperty(someOtherValue);

return object;
}
...
public void doStuff() {
insertObject();

OrientGraph orientGraph = (OrientGraph) framedGraph.getBaseGraph();
orientGraph.commit();

FramedObject object = orientGraph.command ( new OSQLCommand("select from FramedObject where someProperty = ? and someOtherProperty = ?") ).execute(someValue, someOtherValue).iterator().next();

assertNotNull(object);
}
....

Where I expect the addVertex + commit to create the vertex and save it to the database, there are no records created in the class or in V and the SQL query returns null.

@j5bot
Copy link
Author

j5bot commented Mar 17, 2014

When I roll back to using 1.7-SNAPSHOT, the behavior works as expected.

@laa laa added the bug label Mar 17, 2014
@laa laa added this to the 1.7rc2 milestone Mar 17, 2014
@laa laa self-assigned this Mar 17, 2014
@laa
Copy link
Member

laa commented Mar 17, 2014

I see will look on it.

On Mon, Mar 17, 2014 at 5:50 PM, j5bot notifications@github.com wrote:

When I roll back to using 1.7-SNAPSHOT, the behavior works as expected.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-37831838
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@j5bot
Copy link
Author

j5bot commented Mar 17, 2014

I don't believe that the 2014-03-13 snapshot had this issue, either, but the 03-14 did

@j5bot
Copy link
Author

j5bot commented Mar 17, 2014

https://gist.github.com/j5bot/9609066

Works with 1.7-SNAPSHOT but not with 1.7-rc2-SNAPSHOT

@laa
Copy link
Member

laa commented Mar 18, 2014

Which snapshot do you use I got following using your test case:

id before commit: #9:-2
id after commit: #9:0
refetched id: #9:0

Could you try with distribution from http://helios.orientechnologies.com/job/orient-maven/lastStableBuild/ ?

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

I am specifying 1.7-rc2-SNAPSHOT in my maven configurations, pointed at the sonatype repo:

https://oss.sonatype.org/content/repositories/snapshots/com/orientechnologies/orientdb-community/

Is there a repo I can specify to use the build you mention? We are not set up to bundle jars w/o maven and I don't have my own repository server set up at the moment and no time to install one.

@laa
Copy link
Member

laa commented Mar 18, 2014

We have 2 options then.

  1. Wait till tomorrow and try.
  2. Pull source code from develop branch and run mvn install -DskipTests.

What do you prefer ?

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

I absolutely can't wait until tomorrow. I will try #2 ... which branch is stable? Also, could you install this:

https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Maven+Repository+Server ... that would expose your jenkins artifacts as a maven repo.

@laa
Copy link
Member

laa commented Mar 18, 2014

Yes I can install.
Thank you very much.

@lvca
Copy link
Member

lvca commented Mar 18, 2014

I can upload it manually in 20 minutes if needed.

Lvc@

On 18 March 2014 16:32, Andrey Lomakin notifications@github.com wrote:

Yes I can install.
Thank you very much.

Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-37946985
.

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

Yes, please. That would be great.

@laa
Copy link
Member

laa commented Mar 18, 2014

It is uploaded automatically , but it will take about 24 hours to make them
public dunno why.

On Tue, Mar 18, 2014 at 5:33 PM, Luca Garulli notifications@github.comwrote:

I can upload it manually in 20 minutes if needed.

Lvc@

On 18 March 2014 16:32, Andrey Lomakin notifications@github.com wrote:

Yes I can install.
Thank you very much.

Reply to this email directly or view it on GitHub<
#2134 (comment)

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-37947131
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@laa
Copy link
Member

laa commented Mar 18, 2014

Actually could you delete snapshots in your repository and try now ?
Luca told that snapshots are already available ?

On Tue, Mar 18, 2014 at 5:38 PM, Andrey Lomakin lomakin.andrey@gmail.comwrote:

It is uploaded automatically , but it will take about 24 hours to make
them public dunno why.

On Tue, Mar 18, 2014 at 5:33 PM, Luca Garulli notifications@github.comwrote:

I can upload it manually in 20 minutes if needed.

Lvc@

On 18 March 2014 16:32, Andrey Lomakin notifications@github.com wrote:

Yes I can install.
Thank you very much.

Reply to this email directly or view it on GitHub<
#2134 (comment)

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-37947131
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@laa
Copy link
Member

laa commented Mar 18, 2014

Or try mvn clean install -U

On Tue, Mar 18, 2014 at 5:42 PM, Andrey Lomakin lomakin.andrey@gmail.comwrote:

Actually could you delete snapshots in your repository and try now ?
Luca told that snapshots are already available ?

On Tue, Mar 18, 2014 at 5:38 PM, Andrey Lomakin lomakin.andrey@gmail.comwrote:

It is uploaded automatically , but it will take about 24 hours to make
them public dunno why.

On Tue, Mar 18, 2014 at 5:33 PM, Luca Garulli notifications@github.comwrote:

I can upload it manually in 20 minutes if needed.

Lvc@

On 18 March 2014 16:32, Andrey Lomakin notifications@github.com wrote:

Yes I can install.
Thank you very much.

Reply to this email directly or view it on GitHub<
#2134 (comment)

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-37947131
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

ok, i have cleared orientechnologies in my local maven repo and am pulling in latest 1.7-rc2-SNAPSHOT (20140318.153754-97) will try my test case after project builds.

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

same thing although at least my core is marked 153700-97 ... don't know if these have different timestamps on the different jars

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

I'm assuming that the mvn clean install -U you mean is from source branch ... I have a local copy of orient source but need to know what branch I should be on for a stable build and you're giving me maven2 commands for installing artifacts but as I recall the local build is from ant?

@laa
Copy link
Member

laa commented Mar 18, 2014

do you use the same test as me https://gist.github.com/j5bot/9609066 or different one ?

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

The same test ... I am pulling the graph out of a framed graph that is autowired with spring so the one line where I have:

orientGraph = ...

Is:

OrientGraph orientGraph = (OrientGraph) superGraph.getFramedGraph().getBaseGraph();

in my test.

@laa
Copy link
Member

laa commented Mar 18, 2014

Could you provide self containing test case.
I mean full code, which I can copy paste and execute.

On Tue, Mar 18, 2014 at 6:06 PM, j5bot notifications@github.com wrote:

The same test ... I am pulling the graph out of a framed graph that is
autowired with spring so the one line where I have:

orientGraph = ...

Is:

OrientGraph orientGraph = (OrientGraph)
superGraph.getFramedGraph().getBaseGraph();

in my test.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-37951376
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

Passes when I replace the line given above with:

new OrientGraphFactory("plocal: ... ", "admin", "admin").getTx();

Ideas on how this could possibly happen? Will make passing and failing tests as quick as I can but I was told that we would receive skype and google hangout support for issues such as these that are major blockers ...

@laa
Copy link
Member

laa commented Mar 18, 2014

Yes, but you did not mention that you client from commercial support.
What is your skype ?

On Tue, Mar 18, 2014 at 6:11 PM, j5bot notifications@github.com wrote:

Passes when I replace the line given above with:

new OrientGraphFactory("plocal: ... ", "admin", "admin").getTx();

Ideas on how this could possibly happen? Will make passing and failing
tests as quick as I can but I was told that we would receive skype and
google hangout support for issues such as these that are major blockers ...


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-37952057
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

My customer number is in the issue title: Customer 47. skype is alwaysj5

@j5bot
Copy link
Author

j5bot commented Mar 18, 2014

At this point I cannot reproduce the issue unless I am going through our spring autowiring.

@alexduan
Copy link

I am also getting this issue. If I do the following:

ODatabaseDocumentTx db = new ODatabaseDocumentTx(dbUrl)
OClass file = schema.getClass("File")
file = schema.createClass("File").setOverSize(2)
file.createProperty("name", OType.STRING).setMandatory(true).setNotNull(true).createIndex(OClass.INDEX_TYPE.NOTUNIQUE)

ODocument file = new ODocument("File")
file.reset()
file.setClassName("File")
file.field("name", "test")
file.save()

I am unable to retrieve the newly created doc. Rolling back to rc1 and everything works.

@laa
Copy link
Member

laa commented Mar 20, 2014

Sure, your database is not opened.

This test

@test
public class RecordsLostTest {

public void testRecordsLoss() {
ODatabaseDocumentTx db = new
ODatabaseDocumentTx("plocal:./testRecordsLoss");
db.create();

OSchema schema = db.getMetadata().getSchema();
OClass fileClass = schema.createClass("File").setOverSize(2);
fileClass.createProperty("name",
OType.STRING).setMandatory(true).setNotNull(true).createIndex(OClass.INDEX_TYPE.NOTUNIQUE);

ODocument file = new ODocument("File");
file.reset();
file.setClassName("File");
file.field("name", "test");
file.save();

System.out.println(db.load(file.getIdentity(), "*:-1", true));
}
}

provides following output

File#9:0{name:test} v1

If your case still does not work , could you provide valid test ?

On Thu, Mar 20, 2014 at 3:55 PM, Alex Duan notifications@github.com wrote:

I am also getting this issue. If I do the following:

ODatabaseDocumentTx db = new ODatabaseDocumentTx(dbUrl)
OClass file = schema.getClass("File")
file = schema.createClass("File").setOverSize(2)
file.createProperty("name",
OType.STRING).setMandatory(true).setNotNull(true).createIndex(OClass.INDEX_TYPE.NOTUNIQUE)

ODocument file = new ODocument("File")
file.reset()
file.setClassName("File")
file.field("name", "test")
file.save()

I am unable to retrieve the newly created doc. Rolling back to rc1 and
everything works.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-38168948
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@alexduan
Copy link

Sorry, I did not include opening the database (which I do in my code), merely the creation of the database and the insertion. Also, the records themselves are created, but if I go in the console or in a successive call to query for the file (select from File where name='test') will return 0 results.

Again, I had to switch back to RC1 since all my seed scripts have stopped working with RC2.

@laa
Copy link
Member

laa commented Mar 20, 2014

If your scripts stopped to work could you create separate issue about it ?
And we will fix it.

On Thu, Mar 20, 2014 at 5:10 PM, Andrey Lomakin lomakin.andrey@gmail.comwrote:

Which database do you use,
embedded or remote ?

On Thu, Mar 20, 2014 at 5:04 PM, Alex Duan notifications@github.comwrote:

Sorry, I did not include opening the database (which I do in my code),
merely the creation of the database and the insertion. Also, the records
themselves are created, but if I go in the console or in a successive call
to query for the file (select from File where name='test') will return 0
results.

Again, I had to switch back to RC1 since all my seed scripts have stopped
working with RC2.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-38177840
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@laa
Copy link
Member

laa commented Mar 20, 2014

Which database do you use,
embedded or remote ?

On Thu, Mar 20, 2014 at 5:04 PM, Alex Duan notifications@github.com wrote:

Sorry, I did not include opening the database (which I do in my code),
merely the creation of the database and the insertion. Also, the records
themselves are created, but if I go in the console or in a successive call
to query for the file (select from File where name='test') will return 0
results.

Again, I had to switch back to RC1 since all my seed scripts have stopped
working with RC2.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-38177840
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@alexduan
Copy link

I can open a separate issue, although I figured it was a related issue since the vertex and retrieval of that vertex are failing. Let me know if it would be better to create a new one.

I am using embedded:

OServer server = OServerMain.create()
server.startup(new File("/some/location/config/orientdb-server-config.xml"))
server.activate()
Orient.instance().registerEngine(new OEngineLocal())

@laa
Copy link
Member

laa commented Mar 20, 2014

Could you create new one, they are not related.

On Thu, Mar 20, 2014 at 5:19 PM, Alex Duan notifications@github.com wrote:

I can open a separate issue, although I figured it was a related issue
since the vertex and retrieval of that vertex are failing. Let me know if
it would be better to create a new one.

I am using embedded:

OServer server = OServerMain.create()
server.startup(new
File("/some/location/config/orientdb-server-config.xml"))
server.activate()
Orient.instance().registerEngine(new OEngineLocal())


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-38179808
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@lvca
Copy link
Member

lvca commented Mar 24, 2014

What's the status of this issue?

@laa
Copy link
Member

laa commented Mar 24, 2014

We are not sure whether this issue is because of incorrect usage of graph or it still exists we need one more day to check.
@lvca you have written that you had similar issue, was it fixed ?

@lvca
Copy link
Member

lvca commented Mar 25, 2014

In my case the user never closed the graph with .shutdown(), so I think this is different? We should postpone it to 1.7.

@lvca lvca modified the milestones: 1.7, 1.7rc2 Mar 25, 2014
@j5bot
Copy link
Author

j5bot commented Mar 25, 2014

In my case, there may be issues with not calling .shutdown() but there is a call to .commit(). It's my understanding that the call to .commit() should result in the vertex being persisted.

This was the behavior in previous versions of orientdb, and my tests pass when rolling back to 1.7-SNAPSHOT (last time I checked anyway), so there has to be some kind of change on the orientdb side that is resulting in different behavior. Which is not to say that my code is perfect, just to say that I don't think the problem can be entirely pinned on incorrect usage of the graph.

In my case, I am creating a threadlocal instance of a class which then creates an OrientGraphFactory as a member property, using spring (in spring context xml). I then have prototype scoped objects which create OrientGraph / framed OrientGraph instance as members, by calling to the threadlocal object (it's called OrientGraphHandlerImpl) instance, which calls the .getTx() method of the member OrientGraphFactory.

Andrey has links to gists with all of this code if you can please look at them and give us a second set of eyes / perspective.

When I make the OrientGraphHandlerImpl object a singleton in one of my test harnesses for this issue, I am unable to reproduce. When I scope that class prototype in my production code, I am able to work around the issue ... but that is a temporary solution because it is not efficient code AFAIK.

At the moment I am asking for further instruction on making threadlocal instances of OrientGraphFactory and/or OrientGraph (extremely proferably via spring context or annotations) in the correct way, since Andrey feels that the prototype scoped class which has an OrientGraph instance as a member is the root of my issue.

@laa
Copy link
Member

laa commented Mar 25, 2014

HI,
I will chat with you tomorrow if you do not mind.

On Tue, Mar 25, 2014 at 6:26 PM, j5bot notifications@github.com wrote:

In my case, there may be issues with not calling .shutdown() but there is
a call to .commit(). It's my understanding that the call to .commit()
should result in the vertex being persisted.

This was the behavior in previous versions of orientdb, and my tests pass
when rolling back to 1.7-SNAPSHOT (last time I checked anyway), so there
has to be some kind of change on the orientdb side that is resulting in
different behavior. Which is not to say that my code is perfect, just to
say that I don't think the problem can be entirely pinned on incorrect
usage of the graph.

In my case, I am creating a threadlocal instance of a class which then
creates an OrientGraphFactory as a member property, using spring (in spring
context xml). I then have prototype scoped objects which create OrientGraph
/ framed OrientGraph instance as members, by calling to the threadlocal
object (it's called OrientGraphHandlerImpl) instance, which calls the
.getTx() method of the member OrientGraphFactory.

Andrey has links to gists with all of this code if you can please look at
them and give us a second set of eyes / perspective.

When I make the OrientGraphHandlerImpl object a singleton in one of my
test harnesses for this issue, I am unable to reproduce. When I scope that
class prototype in my production code, I am able to work around the issue
... but that is a temporary solution because it is not efficient code AFAIK.

At the moment I am asking for further instruction on making threadlocal
instances of OrientGraphFactory and/or OrientGraph (extremely proferably
via spring context or annotations) in the correct way, since Andrey feels
that the prototype scoped class which has an OrientGraph instance as a
member is the root of my issue.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2134#issuecomment-38586828
.

Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

@lvca
Copy link
Member

lvca commented Mar 25, 2014

@laa please report here the output of the chat for further users ;-)

@laa
Copy link
Member

laa commented Mar 27, 2014

Sure, but we delayed it because test is not ready. I will be back on this issue when test will be ready.

@laa laa removed this from the 1.7 milestone Apr 1, 2014
@lvca lvca added 1 - Next and removed 2 - Working labels Apr 17, 2014
@lvca lvca added this to the 2.0 milestone Apr 17, 2014
@lvca lvca removed the 0 - Backlog label Aug 1, 2014
@lvca
Copy link
Member

lvca commented Aug 28, 2014

Is this still valid?

@lvca
Copy link
Member

lvca commented Aug 28, 2014

Thanks.

@laa
Copy link
Member

laa commented Sep 15, 2014

No answer for 17 days. I close issue.

@laa laa closed this as completed Sep 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants