1 2 Previous Next 17 Replies Latest reply on Jan 24, 2008 6:48 AM by J B

    JDBCacheLoader & hot redeploy

    J B Novice

      Just for your information.

      Using JBoss AS 5.0 Beta 3 and JBoss Cache 2.0. Im using the JDBCCacheLoader, when i do a hot-redeploy my database gets purged. This does not happen when i shutdown and restart.

      And my attribute purgeOnStartUp is set to false.

      Came across it when mucking around.

      Cheers,
      LL

        • 1. Re: JDBCacheLoader & hot redeploy
          J B Novice

          Ill also add in that the JDBC pooling config with C3p0ConnectionFactory doesnt work out of the box with JbossCache 2.0GA. It complains about missing the DataSource class.

          Just FYI,
          LL

          • 2. Re: JDBCacheLoader & hot redeploy
            Manik Surtani Master

            Are you referring to the http session or EJB session cache? Or are you directly using the cache from your application?

            • 3. Re: JDBCacheLoader & hot redeploy
              Manik Surtani Master

              re: pooling, is this still using AS5? Just wondering why you would use the C3p0 conn pooling instead of the JBoss AS conn pooling.

              • 4. Re: JDBCacheLoader & hot redeploy
                J B Novice

                 


                re: pooling, is this still using AS5? Just wondering why you would use the C3p0 conn pooling instead of the JBoss AS conn pooling.


                Yeh using AS 5.0 Beta 3. I ended up using the AS connection pooling in the end but i was mucking around and wanted to get set up as quick as possible so it was easier/quicker to put in the C3po properties to get pooling to work for me, except it didnt ;).


                Are you referring to the http session or EJB session cache? Or are you directly using the cache from your application?

                Its my own application specifc cache!!

                Cheers,
                LL

                • 5. Re: JDBCacheLoader & hot redeploy
                  Manik Surtani Master

                  How do you create the cache? Do you do so programmatically in your application? Or is it via a -beans.xml or mbean service file?

                  • 6. Re: JDBCacheLoader & hot redeploy
                    J B Novice

                     


                    How do you create the cache? Do you do so programmatically in your application? Or is it via a -beans.xml or mbean service file?


                    MBean service file!!

                    • 7. Re: JDBCacheLoader & hot redeploy
                      Manik Surtani Master

                      Just trying to ascertain where the cache lifecycle is controlled (and what calls start, stop, etc). Thanks for this info, will investigate.

                      • 8. Re: JDBCacheLoader & hot redeploy
                        J B Novice

                        Just so you know the hot-deploy isnt working 100% in Beta3 i.e when you touch the .xml files JBoss AS doesnt pick it up that it has changed. I touch the whole directory(I have exploded ear and touch the ear dir to get JBoss AS to kick off a hot-redeploy).

                        Just so you know!!

                        • 9. Re: JDBCacheLoader & hot redeploy
                          Manik Surtani Master

                          Very useful for the AS forums - I suggest you post that comment there.

                          • 10. Re: JDBCacheLoader & hot redeploy
                            J B Novice

                            I already did, they know about it!!

                            • 11. Re: JDBCacheLoader & hot redeploy
                              Manik Surtani Master

                               

                              "lovelyliatroim" wrote:
                              Just for your information.
                              Using JBoss AS 5.0 Beta 3 and JBoss Cache 2.0. Im using the JDBCCacheLoader, when i do a hot-redeploy my database gets purged. This does not happen when i shutdown and restart.

                              And my attribute purgeOnStartUp is set to false.


                              I tried this very briefly, and it worked fine. Hot-redeploy meaning, touching the -service.xml file that defined the cache, correct?

                              Can you confirm that you do not have

                               cache.jdbc.table.drop=true
                              


                              in your JDBCCacheLoader properties?

                              • 12. Re: JDBCacheLoader & hot redeploy
                                J B Novice

                                My config looks like so

                                <attribute name="CacheLoaderConfig" replace="false">
                                 <config>
                                 <!-- are the cache loaders shared in a cluster? -->
                                 <shared>false</shared>
                                 <async>true</async>
                                 <fetchPersistentState>false</fetchPersistentState>
                                 <ignoreModifications>false</ignoreModifications>
                                 <purgeOnStartup>false</purgeOnStartup>
                                
                                 <cacheloader>
                                 <class>org.jboss.cache.loader.JDBCCacheLoader</class>
                                
                                 <properties>
                                 cache.jdbc.datasource=java:/cmdsDB
                                 </properties>
                                
                                 </cacheloader>
                                
                                 </config>
                                 </attribute>
                                
                                


                                Just to give you and idea on my ear package, might have something to do with that



                                +cmds.ear
                                +cmds-cache.jar
                                +meta-inf
                                +cmdsNonPersistenCache-service.xml
                                +meta-inf
                                +cmdsPersistentCache-service.xml
                                +webapp.war
                                +common.jar


                                Just in case directory structure is important, there are 2 things i know that are wrong and havent changed yet. 1. Is why 2 service files in 2 different directory structures?? Well apparently you can only have one-service file in your meta-ing directory, at the moment i have 2 seperate cache configs one for a persistent cache and for a non persistent cache.(Will take out the non persistent config cache and see if this is having an effect, will let you know). 2nd thing wrong is that my cmds-cache.jar should be called cmds-cache.sar but the deployer is still picking up the service file and deploying it so i havent bothered to rename!!

                                What is you directory structure looking like??


                                • 13. Re: JDBCacheLoader & hot redeploy
                                  J B Novice

                                   


                                  I tried this very briefly, and it worked fine. Hot-redeploy meaning, touching the -service.xml file that defined the cache, correct?


                                  I touch the ear directory not the service file !!

                                  Damn indentation didnt come through last time, ill try again

                                  +cmds.ear
                                   +cmds-cache.jar
                                   +meta-inf
                                   +cmdsNonPersistenCache-service.xml
                                   +meta-inf
                                   +cmdsPersistentCache-service.xml
                                   +webapp.war
                                   +common.jar
                                  


                                  • 14. Re: JDBCacheLoader & hot redeploy
                                    J B Novice

                                     


                                    Will take out the non persistent config cache and see if this is having an effect, will let you know)

                                    Makes no difference, still purges DB

                                    1 2 Previous Next