Open db in read-only mode, possible?

717 views
Skip to first unread message

jlist9

unread,
Mar 4, 2012, 2:29:04 AM3/4/12
to orient-...@googlegroups.com
Hi all,

Is there a way to open a DB in a read-only mode? I'm debugging using an embedded DB.
I'm browsing the DB also from console. While console is connected, opening it in code gets
me this error:

Cannot open local storage '/mydir' with mode=rw
at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.open(OStorageLocal.java:208)

I'm hoping that opening it from either side using a read-only mode would solve the problem.
When I look, I didn't find an option to do that. Is there a way to connect to a DB using read-only
mode either from console or Java code?

Thanks,
Jack

Luca Garulli

unread,
Mar 4, 2012, 7:26:01 AM3/4/12
to orient-...@googlegroups.com
Hi Jack,
read-only mode was planned months ago but no one seemed interested so there is no such feature.

To do what you need create a server in your app following this: http://code.google.com/p/orient/wiki/EmbeddedServer

And access to it from console using "remote" protocol. Everything will go fine.

Lvc@

Michael Widmann

unread,
Mar 4, 2012, 9:52:51 AM3/4/12
to orient-...@googlegroups.com
Hi

We may be interested in the "read only" mode...
But couldn't that be achieved by the access settings?

Michael

2012/3/4 Luca Garulli <l.ga...@gmail.com>



--
bayoda.com - Professional Online Backup Solutions for Small and Medium Sized Companies

Luca Garulli

unread,
Mar 4, 2012, 10:06:30 AM3/4/12
to orient-...@googlegroups.com
I think it's not hard to implement but this feature is missing.

Lvc@

jlist9

unread,
Mar 4, 2012, 11:34:52 AM3/4/12
to orient-...@googlegroups.com
Thanks Luca. I think it's a useful feature also for security reasons.
Some clients may only need read access. If it can be configured
in read-only mode it's one less thing to worry about :-)

Luca Garulli

unread,
Mar 4, 2012, 11:41:57 AM3/4/12
to orient-...@googlegroups.com
Can you create a new issue for it? Please check if not yet exists.

Lvc@

jlist9

unread,
Mar 4, 2012, 12:12:42 PM3/4/12
to orient-...@googlegroups.com

Luca Garulli

unread,
Mar 10, 2013, 7:49:10 AM3/10/13
to orient-database, jli...@gmail.com
Hi,
you're right. Indexes are rebuilt everytime the jvm isn't softly closed but with read-only databases this has no much sense. What we need is to reset the softly close flag only at first change. Could you open a new issue for that, please?

Lvc@



On 8 March 2013 13:32, MarkW <mark.w...@pacsol.co.uk> wrote:
Hello,

I have an interest in this as a means to another end. I am developing using Eclipse (using OrientDB in embedded mode) and often terminate the program I am debugging. When I start the program again OrientDB rebuilds the indexes (of which I have about 5) and this can take a minute or so. This happens even if I have only done queries and no updates. So, I'm trying to avoid index rebuilds, and thought that if I could declare read-only intent then that would be a reason not to do the rebuild.

I guess a better implementation would be to know when an index could be out of date and then only rebuild it then. And of course maybe some kind of lazy rebuild of a 'dirty' index on first access or as a background thread when the server has started.

Thanks.

Pacific Solutions International Ltd. Registered office: Grove House, Lutyens Close, Lychpit, Basingstoke RG24 8AG. Registered No: 3113771. This email is private. Please delete it immediately if you are not an intended recipient.

--
 
---
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/groups/opt_out.
 
 

MarkW

unread,
Mar 11, 2013, 6:52:47 AM3/11/13
to orient-...@googlegroups.com, jli...@gmail.com
Thanks for the swift response, issue 1390 raised:

https://github.com/nuvolabase/orientdb/issues/1390


James Wang

unread,
Jun 16, 2015, 6:30:32 AM6/16/15
to orient-...@googlegroups.com, mark.w...@pacsol.co.uk, jli...@gmail.com
Hi All,

Is this feature ready please?  If yes, how to do it please?

Ideally, some sample lines please.

Thanks a lot in advance

James Wang

unread,
Jun 16, 2015, 9:03:02 AM6/16/15
to orient-...@googlegroups.com, jli...@gmail.com, mark.w...@pacsol.co.uk
Would some one shed some light on this please?

Thanks

James Wang

unread,
Jun 16, 2015, 9:10:02 AM6/16/15
to orient-...@googlegroups.com
Sir,  I am interested in this.

Please shed some light.  Thanks a lot in advance
James

l.garulli

unread,
Jun 16, 2015, 12:44:41 PM6/16/15
to orient-...@googlegroups.com, jwang...@gmail.com
Hi guys,
This is not supported right now, but it should be quite easy.

James Wang

unread,
Jun 17, 2015, 4:05:56 AM6/17/15
to orient-...@googlegroups.com, jwang...@gmail.com
Sure.  Thanks.

andrea tomassi

unread,
Nov 16, 2015, 8:12:22 AM11/16/15
to OrientDB
There is some update on read only feature? It would be great!

Karol Pajak

unread,
Mar 5, 2017, 11:11:32 PM3/5/17
to OrientDB
Hi, one of our clients needs this feature too, we would appreciate if you could add this, thanks!

scott molinari

unread,
Mar 6, 2017, 4:52:20 AM3/6/17
to OrientDB
Would setting a user with read only access work?

http://orientdb.com/docs/2.2/Database-Security.html

Scott

Karol Pajak

unread,
Mar 6, 2017, 7:22:20 PM3/6/17
to orient-...@googlegroups.com
I don't think so, they want to be able to open a graph database saved on a read-only file system.

--

---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Karol Pajak | Software Engineer II
ka...@nuix.com | www.nuix.com

Ph: + 61 2 9280 0699 | Fax: +61 2 9212 6902

Level 27, 1 Market Street, Sydney NSW 2000, Australia

Twitter: twitter.com/nuix

scott molinari

unread,
Mar 7, 2017, 4:25:31 AM3/7/17
to OrientDB
Yes, that was the initial intended solution, however, the database could be locked down over user roles and permissions too. The question is, would that also offer a proper solution?

Scott

Karol Pajak

unread,
Mar 7, 2017, 5:23:09 PM3/7/17
to orient-...@googlegroups.com
Then the question is if I open the db with user that has only read-only access - is Orient going to try to open its files in 'rw' mode?
Because this is the error we're getting when opening the db on read-only FS - Orient fails because it opens the files in 'rw' mode. 
I had a look into Orient code and it's possible to pass 'r' mode via URL param, but that will apply only to some files and still for the rest the open mode is harcoded to be 'rw'.

On Tue, Mar 7, 2017 at 8:25 PM, 'scott molinari' via OrientDB <orient-...@googlegroups.com> wrote:
Yes, that was the initial intended solution, however, the database could be locked down over user roles and permissions too. The question is, would that also offer a proper solution?

Scott

--

---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

scott molinari

unread,
Mar 8, 2017, 4:42:51 AM3/8/17
to OrientDB
Ok. I understand the situation now.

For my own curiosity, what is causing the requirement for using ODB with a read only file system?

Scott

Karol Pajak

unread,
Mar 8, 2017, 6:20:06 PM3/8/17
to orient-...@googlegroups.com
Our customers host the data themselves due to security etc. They often have their own constraints where they need to operate on read-only file systems etc.

--

---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages