[INACTIVE][DEV] Persistence v0.76 - Data-Driven Bukkit [677]

Discussion in 'Inactive/Unsupported Plugins' started by NathanWolf, Jan 29, 2011.

  1. Offline


    Persistence - Data-Driven Bukkit

    Persistence is a developer API and framework- NOT a game or admin plugin.

    If you've come here looking for plugin/admin support for Spells, Wand, NetherGate or any other plugin that uses Persistence- please turn around and go back to that thread. Thank you for your cooperation!

    If you're a dev, then check the Persistence wiki for information on using the Persistence framework.

    View changelog on github
    Duccis likes this.
  2. Offline


    This is a dev thread, persistence is just an API- don't be scared :)

    All my plugins require for set up is that you drop the jars in your plugin folder (including Persistence.jar, I link to the jar directly from each plugins' forum thread).

    For Spells, you'll need to set up permissions to cast anything- but you can use Permissions (with PermissionsSupport.jar - again, drop-in) for that if you want.

    If you just want a free-for all magic fest, I've provided a permissions.yml file (another drop-in) to set this up in the Spells thread.

    You really don't have to interact with Persistence at all, it's just there to make the other plugins work.
  3. Offline


    Nada, doesnt work.... i dont know what im doing wrong. i got my persistance, spells, wand, and permissiosn support in my plugin folder, and i got them listed in my server properties.
  4. Offline


    Can you try this: elBukkit.zip

    That's a zip of what I'm running on my public server. It's all working for me (including Permissions support) with CB556, which is latest as of now. I'm also running it (on the public server with 556) using internal permissions, also working.

    Hope that helps!

    UPDATE on 0.75 progress...

    Persistence 0.75 has been running locally for me for a bit. I've got NetherGate and CrowdControl refactored to use it, and it's working well.

    It's going to be a pretty big change- the biggest yet, really. So I want to make it worthwhile.

    I'm hoping, among other things, that 0.75 will drop with MySQL and SQLite support.

    The data store backend is now provided by a separate plugin- I've got SQLite.jar up and running, that's what I'm using for testing. I'm about to install MySQL and get a MySQL.jar plugin going- and I'm hoping to have both ready to release alongside Persistence 0.75.

    Mainly what I'm waiting on right now, honestly (this is a bit selfish) is refactoring Wand/Spells into Magic. This is a really big change for Spells, it's going to start using Persistence now, finally.

    It's also a great way for me to test out all this integration- but it means that Persistence 0.75 is probably ready to go, more or less, you're just waiting for me to finish testing it.

    However, it also means some good stuff for Gameplay fans. A lot of the Spells functionality that I've never gotten around to pushing to Gameplay (mainly the targeting system) is going to be core Persistence tech now, in the Utilities library- so enjoy that when it's here! :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 7, 2016
  5. Offline


    Hi, i'm not a plugin developer or something so i don't know much about editing code. Is it possible that you make a permission file that u can mail to me / UL somewere. (this is too tricky for me)
  6. Offline


    Hi - please go post in the plugin thread for the plugin you want help with (it's not Persistence if you're not a dev...)
  7. Offline


    If I'm getting errors when I load Persistence, should I post on this thread?
  8. Offline

    Bill Kress

    I was looking through the API and had a couple questions (probably more like requests), mostly relating to the concept of "Convention over Configuration"

    If no @PersistField annotations exist, does it persist all the non-transient fields that can be persisted? That would be a reasonable default and save a lot of redundancy for the "normal" case and wouldn't have any effect on existing usage.

    The getters and setters aren't required are they? I hope not--anyway I'd place the annotations by the fields in the example, not the boilerplate/useless getters and setters.

    Finally, in your example:

    PlayerData myPlayer = persistence.get(player.getName(), PlayerData.class); myPlayer.update(player.getLocation()); persistence.put(myPlayer); persistence.save();

    The .put and .save shouldn't be required. It would be much easier and more reliable if you used a weak reference to hold onto the instances you handed out and then automatically updated them when they were no longer being referenced anywhere else. A different method could be used for getting objects that auto-update and ones that must be updated manually (For cases where you rarely change any non-transient members). This is the exact use case Weak References were made for.

    These shouldn't change your configuration-based example at all--the point of convention over configuration is to never limit the capabilities available through "configuration", but to simplify the typical path by removing configuration options when doing the "default"/most typical thing.
  9. Offline


    Preferably not- please post in whatever thread is using persistence, such as Spells or NetherGate.

    Most likely, it's an incompatibility issue- you can also try this zip: elBukkit.zip. I've tested everything in there, it all works together, and also works without Permissions.

    Otherwise, try deleting "plugins/Persistence/*.db" ... failing all of that, go for help in the plugin thread :)

    EDIT: Oh, and if the plugin you're having issues with is not one of mine, do feel free to post here.

    OMG, awesome, dev questions! :D

    It does not- if you @PersistClass without any @PersistFields, it throws an error.

    You need at least one @PersistField, to identify the id. Beyond that... well, I could see some sort of "persist all persistable fields" default - maybe as an option in @PersistClass?

    Good idea! Let me know what you think about that solution.

    Heh- getters and setters are your friend, Java Best Practices, beans support, blahblahblah

    Persistence doesn't care- you can put @PersistField on a field :)

    Just make sure it's public.

    What you're talking about is essentially a garbage collection system, and I don't really want to go down that road.

    Besides, without the first put(), how do I ever get an instance to know to reference it in the first place?

    Maybe I don't fully understand...

    Sure, as long as it's not confusing or misleading, I agree- let me know what you think about having an option to allow for only requiring the id @PesistField?

    Beyond that, I'm not a huge fan of changing default functionality mid-development, if it's possible to avoid it. I have lots of DAO's, myself, for instance that I would not want having their transient data suddenly persisted- it may actually break my client code, in fact.

    In other words, I don't want to use the Java transient annotation- persistable fields are not a blacklist, they're a whitelist :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 7, 2016
  10. Offline

    Bill Kress

    Although you could use one @PersistField to determine the ID, I'd suggest that again convention over configuration might imply that a field named "id" would be the one chosen if no other was specified.

    I don't know if you are kidding or not but they're a pretty horrible pattern (which isn't relevant) and are boilerplate more often than not (which is very relevant). As long as you don't require the getters and setters to exist, I'm happy; Well I'm somewhat happy--does the field really have to be public? Reflection should work great for this I think (But it could be argued that someone tried it and it failed due to speed issues).

    You are right, In researching to give you more detail I found that WeakReference didn't work quite the way I thought it did, so you can't do the auto-saving thing I was thinking of. You could do it with finalizers, but those things aren't ever a good idea. I'm looking into an alternative but I doubt it's going to work.

    I agree, you really shouldn't break anything out there, but perhaps you misread or I mistyped.

    Transient means (by definition) that this data is not part of the objet state that should be persisted. I wasn't suggesting that you start persisting transient fields, just that since you shouldn't persist them anyway, a complete lack of @PersistFields (something that shouldn't exist in any program currently existing) could imply that you want everything persisted by default except transient fields (that you would never persist anyway).

    this cuts the amount of modification to get a class to persist down to just a few new lines--or maybe just a single @PersistClass annotation in the class and a few lines to set up the initial "Get" without forcing any changes to (or breaking) existing code.
  11. Offline


    Yes, they must be public. Trying to access a private or protected member via reflection will throw an InvalidAccessException, as it should.

    Let me be frank for a moment- I have no idea what you're talking about with any of this. When you were going on about "weak references", I thought you were speaking in high-level conceptual terms. I'm not at all familiar with any of this Java functionality- I'm using nothing more complex in Persistence than very basic reflection. I'm not really interested in supporting language features such as "transient"- persistence is not serialization and should not be treated as such.
  12. Offline

    Bill Kress

    Nope, I use it all the time (unless you are running with a security manager, I don't think the Minecraft server does-my mods weren't signed or anything), but it doesn't matter that much. I've even used it specifically to get around the fact that a vendor made a variable private but by changing that variable I could get around a bug in his code.

    transient simply indicates that the field is not part of the state of the object--it doesn't require any specific storage system, but by default is implemented for the only built-in storage system, serialization--but that's cool, don't use it.

    I suppose I'm suggesting that in many (most? all?) cases it would be better to blacklist than whitelist because you will have less intrusion into typical code, but you can actually do both without any change to your existing users. Simply not including any white-list annotation enables saving all by default which also enables black-list annotations.

    Honestly I just like the idea of persistence with virtually no changes to the system/objects, but to tell you the truth when you get into more complex scenarios you end up with the extra configuration info more often than not anyway--it's really just a nice way to lower the learning curve/code changes for a new person to pick up your tool.

    Perhaps I'll start using it for a while before bothering you any more, thank you for your responses and thoughtful consideration though.
  13. Offline


    I promise that it will throw an exception... you can try it out if you don't believe me for some reason :)

    Private means private, not matter how you access a function. This would really be a pretty severe breach of the Java security model if it allowed me access!
  14. Offline


    I'm back. Sorry, i was busy so i could not tried it out.

    I have deleted all the plugins except for the Jail and Permissions. Then i downloaded newest release of Persistence and i still got those damn errors. Craftbukkit build number is 556.

    You said that you don't get them. Do you have any idea what am i doing wrong?

    Errors, to refresh your memory: http://pastebin.com/ab6Xp6eY

    Attached Files:

  15. Offline


    That error... is really weird. I think I had originally suggested that this could be a classpath issue, and that you should try to use a manifest file to resolve it- but these don't really look like dependency issues.

    Can you please link to your current source again? I'll check it out ASAP. I still have the 0.61 (or whatever is current) Persistence source in a separate repo, so I can test it out with what's live.

    I did not get the error you pasted here- but I do remember I got an error. Let me look into it! :)
  16. Offline


    Source is already attached to previous post.
  17. Offline


    Thanks- wasn't sure if you had done anything since then- I'll try it again, but I really though I'd also posted the error I already got :)

    I expect I'll get the exact same error, I haven't touched the Persistence code and IIRC (not to point fingers) it seemed like a client problem unrelated to Persistence- not at all like the error you've got. I'll take a look ASAP- sorry, some career stuff going on in my life at the moment.
  18. Offline


    Did something change with the permanent link you gave to the CraftBukkitUpToDate guy recently, because now its downloading some weird check files and no actual plugin.
  19. Offline


  20. Offline


    Help! The download doesn't work!

    And none of the classes are loading from persistence!! Is your site down? :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 7, 2016
  21. Offline


    Yup, download is broke...
  22. Offline


    I get this error now when using Craftbukkit build 602, worked perfect in built 556:

  23. Offline


    v0.64 is a minor update to the permissions system, which now supports and recognizes an "ops" permissions profile- automatically assigning it to ops.

    Sorry I never saw this- there were some incompatibility issues with a few builds, but I should have everything resolved. 0.63+ works with latest RB (612), and should work with 602 as well, I think.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 7, 2016
  24. Offline


    I have the Permissions support jar in my lugin folder, and it creates a yml copy of my permissions file in the plugin folder, naming it Permissions(worldname), yet Perisitence still says to make an interal permissions system
  25. Offline


    PermissionsSupport.jar creates no files, nor does it copy files. Persistence will bug you to use internal permissions, sorry about that- you can safely ignore that console print. I'll remove it in a future release.

    Please download Persistence from the thread of whatever plugin needs it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 7, 2016
  26. Offline


    Well, for some reason, i cnat use crowd control... Any idea why?
  27. Offline



    What's going on? Are your servers down or is my persistence.jar messed up?
  28. Offline


    Well, it seems that I can use crowd control witht the console, but not as a user on the server. I have permissions set up and the permissions support jar. Could this be related to persisteence?
  29. Offline


    If Persistence is throwing errors, none of my plugins work.

    That said, @mkaster- are you on Windows? My downloads might be all "broken" again for Windows users- Windows doesn't seem to get the concept of a "jar" file without a tremendous amount of guidance from the web server.

    IE will d/l it as a zip file, it's not a zip file and will be corrupted (somehow) by this process. (Don't really understand that part, but I have seen all this for myself- it's like IE un-jars it and then zips it or something!)

    Anyway, I hate Windows, I hate IE, but I'll get this fixed as soon as I can (have my daughter today, so may not be that soon!)
  30. Offline


    Nathan, don't want to bother you, but did you have any luck yet with my Jail plugin?
  31. Offline


    Well, even when i have the permissionssupport jar in, the thing is still not working.

Share This Page