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

SQLStore.put() assumes that at least one field is dirty #41

Open
jnioche opened this issue Jul 19, 2010 · 1 comment
Open

SQLStore.put() assumes that at least one field is dirty #41

jnioche opened this issue Jul 19, 2010 · 1 comment

Comments

@jnioche
Copy link

jnioche commented Jul 19, 2010

if not - we end up with an incorrect SQL query e.g.

INSERT INTO webpages (id )VALUES ('uk.co.bbc.news:http/sport2/hi/video_and_audio/default.stm') ON DUPLICATE KEY UPDATE ;

where nothing follows the update

@dogacan
Copy link
Contributor

dogacan commented Jul 19, 2010

Fixed at 8971b6a .

Also added a test case.

There is a larger problem that still remains unsolved:

T obj = dataStore.get(key);
dataStore.put(anotherKey, obj)

If you do this, Gora will not write anything under anotherKey since obj has no dirty fields. I propose that we store the original key for a Persistent object in its StateManager. If then, someone tries to store it under another key, data store will realize it and write ALL fields whether dirty or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants