• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 14
[RFC] Database Abstraction Proposal - Request for Comments (Devs and DB Admins only!)
#76
I'm really excited to see this is still being worked on Smile I am the sort of nerd who thinks the idea of running a centralized XBMC SQL database is awesome. I have room mates and XBMC is slowly taking over the apartment, so being able to have a central location for our media database will be nice, plus it'll enable me to do some goofy extra stuff, like build some sort of local web page to show them what new media we have. We have a fairly good sized media set, so I'd be happy to do some testing. The only caveat is that no body here runs Linux so I'd be applying patches and compiling on a Windows box. Hope that's OK...
Catchy Signature Here
Reply
#77
firnsy Wrote:I'll look into this and report back. Are there any SQLite errors in your log when running the clean DB (when not deleting entries from the path table manually)?

no, i actually could not locate the actual deleting from the path table when using SQLite, but it does get deleted !!

what i did is that i moved a series folder from its location and then went into xbmc and deleted the series from the library, did a clean db, and then checked the path table under SQLite, and there was no entries for that deleted series. And when i did an update library, it did not show up again. But when doing the same process with mySQL, the entry (that of the series root folder) remained, while the ones of the season's folders where deleted, hence when doing an update library, it showed up again.
Reply
#78
Is there a timeline when this will be added to the trunk? I am currently working on a program which will be able to interface with the new database, but I can't seem to get it to work with sqlite. Then, when it does, it will fail across a network. I'm really interested in seeing this large change come about and would like to hear something.
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#79
outleradam Wrote:Is there a timeline when this will be added to the trunk?
I don't have a timeline as I'm not a dev.

Understandably, I would think that given jmarshall is in the middle of a relatively big db rewrite that this is not getting much attention.

I rebased the patch about 4 weeks ago and will do so again when, if, the dev's decide it's worthwhile to include it. That being said it still patches against the current head without to much grief.
Reply
#80
yes mate, the lack of activity is NOT due to it not being welcome!
Reply
#81
firsny, I've tried out your solution, and got a few errors back. Here they are incase this might be a bug.
I have a fresh install of MySql 5.1.45 Community Server set up and an xbmc-music schema set up with the xbmc user set to have full permissions.
I'm using xbmc-r28256 (01-Mar-2010).

Most things work, however i noticed some errors in the debug log related to a view and a trigger when trying to update the music library for the first time. Here's a peek:
Code:
10:47:28 T:8024 M:4294967295   ERROR: SQL: Undefined MySQL error: Code (1142)
                                            Query: CREATE TRIGGER tgrAlbumInfo AFTER delete ON albuminfo FOR EACH ROW BEGIN delete from albuminfosong where albuminfosong.idAlbumInfo=old.idAlbumInfo; END
10:47:28 T:8024 M:4294967295   ERROR: CMusicDatabase::CreateTables unable to create tables:0
10:47:28 T:8024 M:4294967295   DEBUG: Mysql rollback transaction
10:47:28 T:8024 M:4294967295   ERROR: SQL: The table does not exist
                                            Query: select count(idSong) as NumSongs from songview
10:47:28 T:8024 M:4294967295   ERROR: CMusicDatabase::GetSongsCount() failed

And here's the whole log, with errors starting around line 417 http://pastebin.com/7X8edjhZ

The errors are only related to a music db update. I've had success with the video library and mysql.
It seems to me like it's trying to select data from a view that it never created.
Let me know if I can be of any other assistance and thanks for your hard work. This will be a great solution for keeping my 6 XBMC instances synchronized.

Thanks!

EDIT: I see from firsny's page that he hasn't been posting in the forums in about a month an a half, so if anyone else has an idea or has this working for themselves, let me know. I'm not sure when/if firsny will be back
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#82
EDIT:
Of course, it was my own darn fault. Although I had full schema priveledges for the XBMC users, I did not have "DBDesigner" checked off under Administrative Roles. This is what was causing the create trigger sql to fail.
After this change, it works great!

Image
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#83
bradvido88 Wrote:EDIT: I see from firsny's page that he hasn't been posting in the forums in about a month an a half, so if anyone else has an idea or has this working for themselves, let me know. I'm not sure when/if firsny will be back

He has been quite active on this thread actually but when the xbmc ISP went down about 1 month of forum data was lost. Sad
Reply
#84
Jordan Wrote:He has been quite active on this thread actually but when the xbmc ISP went down about 1 month of forum data was lost. Sad

Exactly.

bradvido88 Wrote:Of course, it was my own darn fault. Although I had full schema priveledges for the XBMC users, I did not have "DBDesigner" checked off under Administrative Roles. This is what was causing the create trigger sql to fail.
After this change, it works great!

Good to hear.
Reply
#85
Jordan Wrote:He has been quite active on this thread actually but when the xbmc ISP went down about 1 month of forum data was lost. Sad
Unluckily some of his and others(jmarshall, spiff, TC!!, etc.) analysis about very interesting topics related to this feature (such as local thumbs cache rebuilding, path storing, etc.) along with some good troubleshooting tips are also gone due to the forum data loss. I hope in the next days they post similar info again in this thread, it was really great reading and discussing material.
Reply
#86
Ahh I see... Yeah that month's lost data threw me off. I'm looking at the cache now and see the posts that were lost. A lot of good stuff!
Thank for the help, and I look forward to seeing this discussion move forward!
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#87
Sad 
I'm now trying to do this on my xbox's. I'm using t3ch's build 28472.
I'm using the same advancedsettings.xml that worked in windows, however the xbox doesn't even try to connect to mysql.
Is this patch implemented on the xbox version? If it is supposed to be, i'll check my configs again and see if i missed anything.
If it's not implemented, I guess I'm SOL for the xboxes
XBMC.MyLibrary (add anything to the library)
ForTheLibrary (Argus TV & XBMC Library PVR Integration)
SageTV & XBMC PVR Integration
Reply
#88
bradvido88 Wrote:I'm now trying to do this on my xbox's. I'm using t3ch's build 28472.
I'm using the same advancedsettings.xml that worked in windows, however the xbox doesn't even try to connect to mysql.
Is this patch implemented on the xbox version? If it is supposed to be, i'll check my configs again and see if i missed anything.
If it's not implemented, I guess I'm SOL for the xboxes Smile

recovered from Google cache:
firnsy Wrote:
Terror Wrote:Far as I can tell it does not work with the XBOX?
You are correct. It only exists on the trunk and hasn't been ported to the XBOX branch.
I'm not sure if the appropriate branch maintainers plan to merge it or not.
Reply
#89
I was looking at the mysql-patch, and have a question and a remark.
Don't know if this belongs in trac, so first in the forum.

In mysqldataset.cpp, regarding MysqlDatabase::nextid

a) Line 245+ : it looks to me that the nextid-field is set to -1 (while logfile shows actual nextid value by using row[0], the record itself is updated with id set to -1). But maybe I overlooked something?

b) With this patch we (can) go from a singleuser db to multiuser. IMHO a nextid function should thus always impement a lock/update with the old value, as another system might have already updates/inserted the row.
EG: update %s set nextid=nextid+1 where seq_name = '%s' and nextid=%d
And then check if rows_affected = 1.

I understand though that the chance that this happens at home is quite small, so might be overkill.
Reply
#90
JPDeckers Wrote:In mysqldataset.cpp, regarding MysqlDatabase::nextid

a) Line 245+ : it looks to me that the nextid-field is set to -1 (while logfile shows actual nextid value by using row[0], the record itself is updated with id set to -1). But maybe I overlooked something?

You haven't missed anything. It would be set to -1.

JPDeckers Wrote:b) With this patch we (can) go from a singleuser db to multiuser. IMHO a nextid function should thus always impement a lock/update with the old value, as another system might have already updates/inserted the row.
EG: update %s set nextid=nextid+1 where seq_name = '%s' and nextid=%d
And then check if rows_affected = 1.

Agreed. However this function is not used, since we make use of autoincrementing fields for id's, thus letting the db backend take care of that.

This function should perhaps be deprecated to prevent its abuse.
Reply
  • 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 14

Logout Mark Read Team Forum Stats Members Help
[RFC] Database Abstraction Proposal - Request for Comments (Devs and DB Admins only!)0