Custom IRoomStorage
Custom IRoomStorage
Is it possible to have our own implementation of the interface and set it to the zone?
Re: Custom IRoomStorage
Hi,
sorry, at the moment this is not supported.
What would be the use case?
Thanks
sorry, at the moment this is not supported.
What would be the use case?
Thanks
Re: Custom IRoomStorage
By documentation, it's using DBManager assigned to the zone, but I'm using Hibernate to access database.
Re: Custom IRoomStorage
Since the serialization and storage to the DB is done by the component, why is Hibernate relevant? You still have your Room data stored to the DB, no?
Re: Custom IRoomStorage
Yup true. But I don't want to activate DbManager just for Room Persistence and I also want to have a custom Room table structure.
It's okay now, I'll implement my own db structure to store data.
THanks
It's okay now, I'll implement my own db structure to store data.
THanks
Re: Custom IRoomStorage
Fair enough. I've added a note in our TODO list to investigate whether we can generalize the Room storage so that developers can plug their own code.
Thanks
Thanks
Re: Custom IRoomStorage
Hi Lapo, I also came across the need to replace the RoomStorage class... for the simple reasons that PostgreSQL's syntax for binary fields ("bytea") is not supported by the supplied database implementation and even when switching to useTextSerialization = true, it serializes the room configuration as JSON and loses all information about the numeric types (Long 1 becomes Int 1 on deserialization) which "breaks" (mistypes) stored room variables on room reload.
Did you by any chance find a way for me to plug in my own IRoomStorage class now?
Inside that class, I'd like to use the DBManager for connection handling, basically just as I do with my custom BuddyStorage.
Thanks a lot!
Cheers,
Niklas
Did you by any chance find a way for me to plug in my own IRoomStorage class now?
Inside that class, I'd like to use the DBManager for connection handling, basically just as I do with my custom BuddyStorage.
Thanks a lot!
Cheers,
Niklas
Re: Custom IRoomStorage
Hi,
we haven't made any progress on this front, sorry, the main reason being it's not a very requested features.
Have you considered using plain local file storage? Room data files are very small and even if you have thousands of Room it won't eat up much disk space.
Cheers
we haven't made any progress on this front, sorry, the main reason being it's not a very requested features.
Have you considered using plain local file storage? Room data files are very small and even if you have thousands of Room it won't eat up much disk space.
Cheers
Re: Custom IRoomStorage
Hi Lapo,
Not a problem, but is there a way to replace the way Rooms are persisted? Because:
Yes, and the main issue here is simply: cloud- and container-hosting. The SFS2X is not bound to a host in our (container-based) setup (as is nothing except the database and even that is being worked on). It could become teared down and fired up again, even with two instances running simultaneously during a very short period of time during deployment. We could set up a networking file system we can mount into the SFS2X instance - or use the database, with the latter being much easier... That's why I put quite some time into bringing everything into the database.
Cheers,
Niklas
Lapo wrote:we haven't made any progress on this front, sorry, the main reason being it's not a very requested features.
Not a problem, but is there a way to replace the way Rooms are persisted? Because:
Lapo wrote:Have you considered using plain local file storage? Room data files are very small and even if you have thousands of Room it won't eat up much disk space.
Yes, and the main issue here is simply: cloud- and container-hosting. The SFS2X is not bound to a host in our (container-based) setup (as is nothing except the database and even that is being worked on). It could become teared down and fired up again, even with two instances running simultaneously during a very short period of time during deployment. We could set up a networking file system we can mount into the SFS2X instance - or use the database, with the latter being much easier... That's why I put quite some time into bringing everything into the database.
Cheers,
Niklas
Re: Custom IRoomStorage
Hi,
You can bypass the standard Room persistence system entirely and build your own that stores data to your database, if this is what you're asking.
If it can help I can send you the sources of the database persistence class we use, so you can see how we serialize Rooms and implement something similar that works for you.
You can request it to our support@... email box, adding a link to this discussion for reference.
Hope it helps
Not a problem, but is there a way to replace the way Rooms are persisted? Because:
You can bypass the standard Room persistence system entirely and build your own that stores data to your database, if this is what you're asking.
If it can help I can send you the sources of the database persistence class we use, so you can see how we serialize Rooms and implement something similar that works for you.
You can request it to our support@... email box, adding a link to this discussion for reference.
Hope it helps
Who is online
Users browsing this forum: No registered users and 98 guests