3 Replies Latest reply on Jan 29, 2004 4:26 PM by Viet

    Role of the Database in Nukes

    mcscottmc Newbie

       

      "mcscottmc" wrote:
      In the O'Reilly article, Marc said:

      "Each MBean attribute is persisted in the relational database as well, avoiding the loss of configuration when you restart the server."

      Following his example, I used the JMX console to edit the SiteName and Slogan just like he did in the article. Sure enough, the changes appeared in the nuke_services_attributes table in the database. However, looking at that table it seems pretty sparse. For example, there are no attributes for defining the layout of the various blocks. The layout, from what I can tell, is defined in the jboss-service.xml file in the nukes.sar.

      Here are some questions:

      1. How does nukes load its configurations? Does it look in the db first, and if the attribute is not there it refers to the jboss-service.xml?

      2. How is everyone configuring their site? Do you have your own custom jboss-service.xml that you are deploying in place of the one provided in the CVS? Or are you configuring everything using the admin web interface and JMX console?

      3. What is the nuke_services table. Mine is empty. What is it used for?

      Thanks
      -Scott


        • 1. Re: Role of the Database in Nukes
          Viet Master

           

          "cooper" wrote:
          the module/block to be persistent must be created with the persistent value set to true (in the constructor)

          1.it syncs with the DB : if the attribute is not in the DB, then it is written with the actual value in the XML setting, otherwise it is taken from the DB and loaded.

          2.nukes_services is used for dynamic block creation (index.html?module=block) here you can create blocks. this module has still osme issues :-( but it works a bit. We have to fix that.


          • 2. Re: Role of the Database in Nukes
            mcscottmc Newbie

             

            "mcscottmc" wrote:
            Thanks for the info, Julien.

            Here is an update for anyone following this thread:

            I edited the jboss-service.xml in the nukes.sar to make the MenuBlock persistent. This is useful if you would like to add links to the menu. To make the MenuBlock persistent, I added a boolean parameter to the constructor. When I restarted JBoss, the MenuBlock's attributes were added to the database and any changes I made in the JMX console were persisted.

            Does anyone know of any way to do what I just did rather than rebuilding the entire nukes.ear? It seems like overkill to do that, but it is looking more and more like maintaining my own jboss-service.xml in the nukes.sar is the way to go.

            -Scott


            • 3. Re: Role of the Database in Nukes
              Viet Master

               

              "cooper" wrote:
              you did the right way.

              ideally all blocks should be persisted in the database OR be specified in the block module, so it would be entirely customizable : add / remove blocks