Using Hibernate as a CacheStore for Coherence

I am trying understand the coherence function for my project new requirement.
I've developed small application Using Hibernate as a CacheStore for Coherence
(http://wiki.tangosol.com/display/COH34UG/Using+Hibernate+as+a+CacheStore+for+Coherence)
I tried to remove the object from cache Using NamedCache.remove(Object) method.But object got removed from database and cache as well.
I don't want to remove from database table.
Is there way to remove the object only from cache and retain in the table???
Thanks
Kaleem

Sure -- you can extend built-in HibernateCacheStore and override erase/eraseAll methods as no-ops.
- Aleks

Similar Messages

  • Can HotCache use Hibernate

    I have been teaching myself the new Oracle Coherence HotCache technology & am playing around with it.
    I have a question about the JPA implementation. From what I have read, HotCache is built on TopLink & uses the JPA mappings metadat to update the cache from the database. Does that mean that the application using it HAS to be using TopLink. Would something like Hibernate work?
    Thanks!
    Nidhi

    Of course, you can use Hibernate as the CacheStore / CacheLoader of Coherence, or you can use Coherence as the second layer cache of Hibernate.

  • Any tutorial for using Hibernate in Jdeveloper?

    Hi
    thank you for reading my post
    is there any tutorial that helps with using Hibernate with Jdeveloper?
    specially the ant task stuff about schema generator and Hibernate annotation?
    Thanks

    Hi,
    The previous problem is solved but now getting another error
    500 Internal Server Error
    javax.faces.FacesException: #{Catalog.commandButton_action}: javax.faces.el.EvaluationException: java.lang.NullPointerException
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:98)
         at javax.faces.component.UICommand.broadcast(UICommand.java:332)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:711)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.1.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
         ... 20 more
    Caused by: java.lang.NullPointerException
         at hibernate.HibernateDB.getData(HibernateDB.java:168)
         at hibernate.Catalog.commandButton_action(Catalog.java:112)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
         ... 21 more
    Where line 168 is
    result[0] = new String(""+catalog.getId());
    please help.
    Thanks

  • How can configure weblogic for use Hibernate

    Hello everybody, my question is how can I configureit weblogic for use hibernate.
    I'm using JDeveloper 11g but I did not show any error when I run my jsp page, the page shows me all, but it is as if it never made the connection. the data of my table are empty.
    Thanks for your answers.

    thanks for answer. The jar was wrong, now I get not error, but also does not show me anything on my board ADF. seems to not connect. this is what I get in your log JDeveloper:
    C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\bin\startWebLogic.cmd
    [waiting for the server to complete its initialization...]
    JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m
    WLS Start Mode=Development
    CLASSPATH=;C:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_cie660\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\JDK160~1\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.0.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.5/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;C:\Oracle\Middleware\jdeveloper\modules\features\adf.share_11.1.1.jar;;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\eval\pointbase\lib\pbclient57.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\xqrl.jar;;
    PATH=C:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\native;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\native;C:\Oracle\MIDDLE~1\patch_cie660\profiles\default\native;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.5\bin;C:\Oracle\MIDDLE~1\JDK160~1\jre\bin;C:\Oracle\MIDDLE~1\JDK160~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Archivos de programa\Intel\DMIX;C:\Archivos de programa\Java\jdk1.6.0\bin;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8
    * To start WebLogic Server, use a username and *
    * password assigned to an admin-level user. For *
    * server administration, use the WebLogic Server *
    * console at http:\\hostname:port\console *
    starting weblogic with Java version:
    java version "1.6.0_05"
    Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
    Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
    Starting WLS with line:
    C:\Oracle\MIDDLE~1\JDK160~1\bin\java -client -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m -XX:MaxPermSize=128m -Xmx512m -Djbo.34010=false -Xverify:none -da -Dplatform.home=C:\Oracle\MIDDLE~1\WLSERV~1.3 -Dwls.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Dweblogic.home=C:\Oracle\MIDDLE~1\WLSERV~1.3\server -Ddomain.home=C:\Oracle\MIDDLE~1\JDEVEL~1\system\SYSTEM~1.88\DEFAUL~1 -Doracle.home=C:\Oracle\Middleware\jdeveloper -Doracle.security.jps.config=C:\Oracle\MIDDLE~1\JDEVEL~1\system\SYSTEM~1.88\DEFAUL~1\config\oracle\jps-config.xml -Doracle.dms.context=OFF -Djava.protocol.handler.pkgs=oracle.mds.net.protocol -Dweblogic.management.discover=true -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1030\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_cie660\profiles\default\sysext_manifest_classpath -Dweblogic.Name=DefaultServer -Djava.security.policy=C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.policy weblogic.Server
    <06-02-2009 10:50:27 AM VET> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath:
    C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\antlr-2.7.6.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\asm.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\cglib-2.1.3.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\commons-collections-3.2.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\commons-logging-1.0.4.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\dom4j-1.6.1.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\hibernate3.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\jdom.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\jta.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\jtds-1.2.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\log4j-1.2.14.jar;C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\lib\mysql-connector-java-3.1.7-bin.jar;C:\Oracle\Middleware\patch_wls1030\profiles\default\sysext_manifest_classpath\weblogic_ext_patch.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\beehive_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\beehive_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\beehive_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\beehive_zh_TW.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\p13n_wls_zh_TW.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\testclient_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\testclient_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\testclient_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\testclient_zh_TW.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\tuxedocontrol_zh_TW.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\workshop_ja.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\workshop_ko.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\workshop_zh_CN.jar;C:\Oracle\Middleware\wlserver_10.3\L10N\workshop_zh_TW.jar>
    <06-02-2009 10:50:28 AM VET> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 10.0-b19 from Sun Microsystems Inc.>
    <06-02-2009 10:50:28 AM VET> <Info> <Management> <BEA-141107> <Version: WebLogic Server Temporary Patch for CR380042 Thu Sep 11 13:33:40 PDT 2008
    WebLogic Server Temporary Patch for 7372756 Fri Sep 12 17:05:44 EDT 2008
    WebLogic Server Temporary Patch for CR381265 Wed Oct 08 10:15:58 PDT 2008
    WebLogic Server Temporary Patch for CR380913 Wed Oct 15 13:24:22 PDT 2008
    WebLogic Server Temporary Patch for CR381739 Tue Oct 21 14:06:14 IST 2008
    WebLogic Server 10.3 Mon Aug 18 22:39:18 EDT 2008 1142987 >
    <06-02-2009 10:50:29 AM VET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <06-02-2009 10:50:29 AM VET> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool>
    <06-02-2009 10:50:29 AM VET> <Notice> <Log Management> <BEA-170019> <The server log file C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\DefaultDomain\servers\DefaultServer\logs\DefaultServer.log is opened. All server side log events will be written to this file.>
    <06-02-2009 10:50:32 AM VET> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
    <06-02-2009 10:50:36 AM VET> <Warning> <Deployer> <BEA-149617> <Non-critical internal application uddi was not deployed. Error: [Deployer:149158]No application files exist at 'C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\uddi.war'.>
    <06-02-2009 10:50:36 AM VET> <Warning> <Deployer> <BEA-149617> <Non-critical internal application uddiexplorer was not deployed. Error: [Deployer:149158]No application files exist at 'C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\uddiexplorer.war'.>
    <06-02-2009 10:50:37 AM VET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
    <06-02-2009 10:50:37 AM VET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
    <06-02-2009 10:50:38 AM VET> <Notice> <Log Management> <BEA-170027> <The Server has established connection with the Domain level Diagnostic Service successfully.>
    <06-02-2009 10:50:38 AM VET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN>
    <06-02-2009 10:50:38 AM VET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING>
    <06-02-2009 10:50:38 AM VET> <Warning> <Server> <BEA-002611> <Hostname "FAMILIA_KAWAIDA.mshome.net", maps to multiple IP addresses: 10.0.0.1, 201.222.105.26, 127.0.0.1>
    <06-02-2009 10:50:38 AM VET> <Warning> <Server> <BEA-002611> <Hostname "FAMILIA_KAWAIDA", maps to multiple IP addresses: 10.0.0.1, 201.222.105.26, 127.0.0.1>
    <06-02-2009 10:50:38 AM VET> <Warning> <Server> <BEA-002611> <Hostname "localhost", maps to multiple IP addresses: 10.0.0.1, 201.222.105.26, 127.0.0.1>
    <06-02-2009 10:50:38 AM VET> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7101 for protocols iiop, t3, ldap, snmp, http.>
    <06-02-2009 10:50:38 AM VET> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 201.222.105.26:7101 for protocols iiop, t3, ldap, snmp, http.>
    <06-02-2009 10:50:38 AM VET> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 10.0.0.1:7101 for protocols iiop, t3, ldap, snmp, http.>
    <06-02-2009 10:50:38 AM VET> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "DefaultServer" for domain "DefaultDomain" running in Development Mode>
    <06-02-2009 10:50:38 AM VET> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
    <06-02-2009 10:50:38 AM VET> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    DefaultServer startup time: 16953 ms.
    DefaultServer started.
    [Running application TVB on Server Instance DefaultServer...]
    ---- Deployment started. ---- Feb 6, 2009 10:50:43 AM
    Target platform is (Weblogic 10.3).
    Running dependency analysis...
    2009-02-06 10:50:43.64: Writing WAR file to C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\TVB\TVB-TVB-webapp
    2009-02-06 10:50:43.687: Wrote WAR file to C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\TVB\TVB-TVB-webapp
    2009-02-06 10:50:43.906: Writing EAR file to C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\TVB
    2009-02-06 10:50:43.921: Wrote EAR file to C:\Oracle\Middleware\jdeveloper\system\system11.1.1.0.31.51.88\o.j2ee\drs\TVB
    Deploying Application...
    <06-02-2009 10:50:47 AM VET> <Warning> <J2EE> <BEA-160195> <The application version lifecycle event listener oracle.security.jps.wls.listeners.JpsAppVersionLifecycleListener is ignored because the application TVB is not versioned.>
    06-02-2009 10:50:47 AM oracle.adf.share.config.ADFConfigFactory cleanUpApplicationState
    INFO: Cleaning up application state
    ADF Library non-OC4J post-deployment (millis): 16
    06-02-2009 10:51:08 AM oracle.adfinternal.view.faces.partition.FeatureUtils _addFeatures
    ADVERTENCIA: A duplicate definition for the feature "AdfDvtGraph" has been found at zip:C:/Oracle/Middleware/jdeveloper/system/system11.1.1.0.31.51.88/DefaultDomain/servers/DefaultServer/tmp/_WL_user/TVB/6mq9lg/war/WEB-INF/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 3. A feature with the same name was originally defined at zip:C:/Oracle/Middleware/jdeveloper/dvt/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 3. This may indicate that multiple copies of the same jar file are present on the class path. Ignoring the new feature definition.
    06-02-2009 10:51:08 AM oracle.adfinternal.view.faces.partition.FeatureUtils _addFeatures
    ADVERTENCIA: A duplicate definition for the feature "AdfDvtGauge" has been found at zip:C:/Oracle/Middleware/jdeveloper/system/system11.1.1.0.31.51.88/DefaultDomain/servers/DefaultServer/tmp/_WL_user/TVB/6mq9lg/war/WEB-INF/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 7. A feature with the same name was originally defined at zip:C:/Oracle/Middleware/jdeveloper/dvt/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 7. This may indicate that multiple copies of the same jar file are present on the class path. Ignoring the new feature definition.
    06-02-2009 10:51:08 AM oracle.adfinternal.view.faces.partition.FeatureUtils _addFeatures
    ADVERTENCIA: A duplicate definition for the feature "AdfRichPivotTable" has been found at zip:C:/Oracle/Middleware/jdeveloper/system/system11.1.1.0.31.51.88/DefaultDomain/servers/DefaultServer/tmp/_WL_user/TVB/6mq9lg/war/WEB-INF/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 11. A feature with the same name was originally defined at zip:C:/Oracle/Middleware/jdeveloper/dvt/lib/dvt-faces.jar!/META-INF/adf-js-features.xml, line 11. This may indicate that multiple copies of the same jar file are present on the class path. Ignoring the new feature definition.
    Application Deployed Successfully.
    Elapsed time for deployment: 26 seconds
    ---- Deployment finished. ---- Feb 6, 2009 10:51:09 AM
    Run startup time: 26766 ms.
    [Application TVB deployed to Server Instance DefaultServer]
    Target URL -- http://127.0.0.1:7101/TVB-TVB-context-root/faces/seguridad/grupo.jspx
    06-02-2009 10:51:17 AM oracle.adfinternal.controller.faces.lifecycle.JSFLifecycleImpl setLifecycleContextBuilder
    ADVERTENCIA: ADFc: Sustituyendo la implementación del ciclo de vida de la página de ADF por 'oracle.adfinternal.controller.application.model.JSFDataBindingLifecycleContextBuilder'.
    06-02-2009 10:51:17 AM oracle.as.jmx.framework.PortableMBeanFactory setJMXFrameworkProviderClass
    INFO: Marco portátil JMX inicializado con el SPI de plataforma "class oracle.as.jmx.framework.wls.spi.JMXFrameworkProviderImpl"
    06-02-2009 10:51:17 AM oracle.adfinternal.controller.util.model.AdfmInterface initialize
    INFO: ADFc: BindingContext está presente, utilizando las API de ADFm para DataControlFrames.
    06-02-2009 10:51:17 AM oracle.adfinternal.controller.metadata.provider.MdsMetadataResourceProvider <init>
    INFO: ADFc: Almacenamiento de recursos de metadatos de MDS en la caché del controlador ACTIVADO.
    06-02-2009 10:51:17 AM oracle.adf.controller.internal.metadata.MetadataService$Bootstrap add
    INFO: ADFc: Cargando metadatos de inicialización de '/WEB-INF/adfc-config.xml'.
    thanks in advance for your response.

  • When we use jsf can we also use hibernate or ejb for database visting.

    when we use jsf can we also use hibernate or ejb for database visting.

    http://blog.exadel.com/?p=8
    http://java.sys-con.com/read/46977.htm
    http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html
    http://www.jroller.com/page/ksevindik/?anchor=lookup_tables_with_hibernate_and
    Sergey : http://jsfTutorials.net

  • Using Hibernate as a Custom Component

    I don’t know whether this question is appropriate in LC context.
    Our scenario, We have very complex logic in each of JDBC store/retrieve activity in the process. We would like to move this part into Hibernate based custom component.
    We tried with simple Hibernate persistence class but it seems to be LC not loading them.
    1)      Is this the restriction with LC? (using hibernate as a custom component)
    2)      What is the appropriate solution?
    You help is highly appreciated

    Jasmin,
    Is your class included in the custom component?
    Yes, It is a annotated entity class,
    When creating sessionFactory it is not loading the class.
    i'm using flowing code block for creating sessionFactory,
    factory =
    new AnnotationConfiguration().addAnnotatedClass(dao.entity.UserEntity.
    class).setProperty(
    "hibernate.dialect",m_dialect ).setProperty(
    "hibernate.connection.driver_class", m_driverClass).setProperty(
    "hibernate.connection.url", m_connectionUrl ).setProperty(
    "hibernate.connection.username",m_userName).setProperty(
    "hibernate.connection.password", m_password).setProperty(
    "hibernate.hbm2ddl.auto", m_hbmTodll ).setProperty(
    "current_session_context_class",m_contextClass ).configure(resource).buildSessionFactory();
    Is the jar referenced in the class patch section of the component.xml?
    Yes , I have tried for this approch too , but class is entity class is not loaded.

  • Using Hibernate Functionality and pass it on to the JCAPS Oracle eWay

    Hi All,
    I need to use the Existing Hibernate API's and pass it on to the JCAPS oracle eWay to persist the Data.
    As the present Application is using the Hibernate for persisting the Data as we have parent child relation with multiple tables , so we need to push the whole thing in to JCAPS.
    Thanks & regards
    Srikanth

    narayanaa wrote:
    Hi,
    You cannot use hibernate using oracle or any other database eWays. If you want to leverage the same or the existing code you have for the Data Access you use JCD.
    So what you can do is have the required jars available for the application and then use the available classes with in the JCD.
    Thanks,
    NarayanaaI don't think that is secesarily true. You can use oracle eWay to handle the database connection, pooling and XA transactions. You just retrieve the java.sql.Connection object from the eWay and use that in you hibernate code.
    -Mario

  • About using hibernate with mysql

    hi all,
    i have used hibernate with hsqldb(database given by default) and it works fine.but when i tried to use it with mysql then i have encountered a problem
    xception
    org.hibernate.TransactionException: Transaction not successfully started
         org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
         events.EventManagerServlet.doGet(EventManagerServlet.java:63)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    though i have put jar file of mysql in lib directory and changed the driver name in hibernate.cfg.xml.
    can any one place some example illustrating the steps involving.thanx

    Hi smogura,
    Thanks for the message. Ok I did as you told. I believe I went to the right place:
    Resource->JDBC Connection pools. However I wasn't sure how exactly to go about setting connection pools,
    so I went to the web and did a search and I managed to get hold of this
    website:http://www.albeesonline.com/blog/2008/08/06/creating-and-configuring-a-mysql-datasource-in-
    glassfish-application-server/
    I followed from steps 4 onwards. However at step 14, I did not get a sucesfull ping. The values I used are as follows:
    General:
    Name:               MySQL
    Datasource Classname:     com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
    Resource Type:           javax.sql.ConnectionPoolDataSource
    Advanced Properties:
    databaseName:      ebooking
    ServerName:     GlassFish
    URL          jdbc:mysql://localhost:3306/ebooking
    password          *****
    user:          1234
    I am not sure what is wrong, by the way, I am using Glassfish V3 that comes bundled with netbeans. Any idea what's wrong or missing? Thanks
    regards

  • Problems building JavaDoc of classes using Hibernate/javax.persistence

    Hallo!
    I am trying to create the javadoc of classes that use hibernate. First it starts of with error messages like
      [javadoc] SubmissionSet.java:40: cannot find symbol
      [javadoc] symbol: class Table
      [javadoc] @Table(name="submissionset"/*, schema = "reg"*/)or
      [javadoc] Employee.java:8: package javax.persistence does not exist
      [javadoc] import javax.persistence.JoinColumn;
      [javadoc]                         ^Afterwards it gets even strange with exceptions within javadoc like:
    [javadoc] java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
      [javadoc]     at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.util.Util.isDeprecated(Util.java:811)
      [javadoc]     at com.sun.tools.doclets.formats.html.TagletWriterImpl.deprecatedTagOutput(TagletWriterImpl.java:70)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.taglets.DeprecatedTaglet.getTagletOutput(DeprecatedTaglet.java:40)
      [javadoc]     at com.sun.tools.doclets.formats.html.MethodWriterImpl.writeDeprecated(MethodWriterImpl.java:166)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.buildDeprecationInfo(MethodBuilder.java:183)
      [javadoc]     at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      [javadoc]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [javadoc]     at java.lang.reflect.Method.invoke(Method.java:597)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.builders.MethodBuilder.invokeMethod(MethodBuilder.java:109)
      [javadoc]     at com.sun.tools.doclets.internal.toolkit.bu    at java.lang.reflect.Method.invoke(Method.java:597)
      [javadoc]     at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
      [javadoc]     at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
      [javadoc]     at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
      [javadoc]     at com.sun.tools.javadoc.Start.begin(Start.java:128)
      [javadoc]     at com.sun.tools.javadoc.Main.execute(Main.java:41)
      [javadoc]     at com.sun.tools.javadoc.Main.main(Main.java:31)I suppose the problem is somehow linked to the usage of hibernate since the same ant script works for other projects (that don't use hibernate...). Do you have an idea what could be wrong?
    Thanks in advance
    Patrick

    See [http://forums.sun.com/thread.jspa?threadID=5333060&tstart=0]. In general, if you use third-party libraries in your code, you should include these libraries in Javadoc's classpath option when generating documentation.

  • Program error in using Hibernate in MyEclipse IDE

    Hi,
    I have two classes student and staff.I am trying for student class only.And the database tables are student and staff. I am using 10g database.
    Student(studentId,name,email,password).
    I want delete a row from the database using hibernate. I am testing it in TestClient program. when adding a record it is adding correctly and placing it in database but when deleting and listing it is giving an error. The following error is coming.
    Hibernate: select max(studentid) from student
    Successfully inserted the record.
    Hibernate: insert into student (name, email, password, studentid) values (?, ?, ?, ?)
    Exception in thread "main" java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
    +-[IDENT] IdentNode: 'studentid' {originalText=studentid}
         at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:145)
         at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:712)
         at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:536)
         at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
         at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
         at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
         at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
         at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
         at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
         at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
         at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
         at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
         at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
         at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
         at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
         at com.client.TestClient.listStudentByGroupId(TestClient.java:72)
         at com.client.TestClient.main(TestClient.java:88)
    Can anyone help how to solve this. I am using MyEclipse IDE.
    Thanks

    I am using MyEclipse IDE.Doesn't matter.
    Have you looked at the Hibernate Docs, website, and forums?

  • Hibernate Query vs PreparedStatement for SQL

    Hi,
    I am using Hibernate for DAO classes, which i am using for the basic CRUD operations. But for complex queries with complex joins i am writing the SQL.
    In such case whether it is better to use the Query.createSQLQuery(String sql) to invoke the SQL or better to use the PreparedStatement since i am invoking only the SQL as supposed to HQL by getting the connection from the Hibernate Session. Since the PreparedStatement is precompiled it may be faster than invoking the SQL through the Query.createSQLQuery(String sql)? or using the Session.getNamedQuery(QUERY_NAME)? Please let me know your opinion on this.
    Thanks

    Whether you use Hibernate, ODBC, BDE, or Funky Foo's SQL client library, Oracle does not give a damn.
    It receives a statement from the client. This can either be SQL or an anonymous PL/SQL block. It parses it as a cursor. It then provides the client with a cursor handle to reference the cursor.
    The cursor is essentially a program. If it has bind variables, it is a program that accepts parameter input. This allows the very same program to be executed multiple times with different input parameters. For example, executing the same INSERT SQL cursor for different values and inserting multiple rows using the very same cursor.
    A cursor can also (like a program), produce output. An example is a SELECT cursor - where the fetch interface of the cursor enables the caller to consume the output of the cursor.
    So what is optimal in this respect? First and foremost cursors that are created using and used with bind variables. Secondly, re-using the very same client cursor handle (and not just the same server side SQL cursor) where possible (e.g. like repeating the same SQL INSERT statement with different values).
    The question to asked is whether the method you select to use on the client side - be that Hibernate or Funky Foo SQL, support this?
    The consideration to make is the following. Why code SQL in the client side? SQL is executed on the server-side - refers to server side data structures and needs to be tuned on the server. Put that code in a client and it significantly increases the complexity and decrease the flexibility of SQL.
    The alternative (and recommended approach) is to use PL/SQL to encapsulate all SQL. Instead of the client (and client programmer) needing to know SQL, a PL/SQL call interface is provided with calls like GetInvoice() to return a single specific invoice, or GetInvoiceByDate() that returns selected invoices for a date range. The PL/SQL code creates the SQL cursor and returns the client cursor handle as a reference cursor to the caller.
    This also allows business and validation logic to be implemented in the PL/SQL call interface to protect data integrity and business transaction sanity. A database structure change requires the SQL inside a PL/SQL procedure to be changed - without having to touch the client code. Likewise, SQL can be tuned and improved without having recompile a single byte of client code. And the same PL/SQL call interface services all clients - unlike multiple Java clients duplicating the same SQL (and not always correctly) to do the same thing, or having to duplicate and repeat the same data validation and business rule logic.

  • Using Hibernate on OC4J 10.1.3

    How can I use hibernate in my application server, anyone has a reference?
    Thanks.

    There's an easy way if you don't need hibernate to be working behind the scene (e.g, replacing TopLink as the JPA implementation).
    Basically, you just need to initialize hibernate SessionFactory once on startup, and put it somewhere accessible from your business logic code.
    On servlet container, usually you would want to attach a ContextLoaderListener and initialize hibernate there and put it in ServletContext. You can then get sessionFactory from your servlets using httpServletRequest.getSession().getServletContext().
    Same idea for ejb. I'm not sure how to accomplish that though. Maybe instantiating the sessionFactory in a startup listener and register it on JNDI. I'm not sure, still learning all these EJB stuff.
    Rudi

  • Configure webservices as datasource for coherence

    Is it possible to directly configure webservices as datasource for coherence. So that after a preconfigured period of time, the cache refreshes itself. If yes samples/ documentation for the same.

    Hi Tally,
    you can do almost that, but not exactly that with out-of-the-box features only.
    You can use the refresh-ahead feature of the read-write backing map with which a get to a key will cause the refresh of the entry value from the cache loader which will be seen by the subsequent get to the same key.
    Alternatively you can schedule your own periodic processing with some timer which fetches data from the backing storage and it puts it into the cache.
    A mix of the two would be to have the periodic processing issue the get requests which trigger the refresh-ahead behaviour.
    Best regards,
    Robert

  • Hibernate all workstations idle for at least 30 minutes, after 10:00pm

    Recently i came a across a challenge launched by my boss: Hibernate all workstations idle for at least 30 minutes, after 10:00pm.
    By GPO, i can. So, i wrote a script.
    I'm using a System.Runtime.InteropServices;
    I'm not good in scripts, for this i need help to improve it.
    Please, help me. Thank you.

    Recently i came a across a challenge launched by my boss: Hibernate all workstations idle for at least 30 minutes, after 10:00pm.
    By GPO, i can. So, i wrote a script.
    I'm using a System.Runtime.InteropServices;
    I'm not good in scripts, for this i need help to improve it.
    Please, help me. Thank you.
    You ask for help improving a script that you already wrote, but you don't provide said script, nor tell us which part of the script you're having difficulties with... This makes it a bit hard to help you...
    Still, I would not suggest going down the route of creating a script for this. Yes it can obviously be done, but there are mechanisms out there that are already more appropriate for handling such things which do not involve re-inventing the wheel: GPO and
    Scheduled Tasks are two of them.
    If you create it as a *pure* script with no "help" from outside applications, you need to consider these things:
    - How do I deploy the script to every machine?
    - The script will need to be running in the background the whole time, from the time the computer starts up until it shuts down (it will sit idly doing absolutely nothing until it's past 10:00, but it will be running in the background nonetheless).
    - How do you ensure it's running properly?
    - Who will support it going forward?
    If you use a GPO, you don't have to worry about any of those things (except about how to tell whether it's running properly).
    Alternatively, you could also create a scheduled task which kicks off at 10:00 daily with a condition of only start if computer is idle for over 30m where the command that it executes is to hibernate the computer. Scheduled tasks can also be created by GPO,
    so you don't have to worry about many of the things you would normally have to worry about if you were using a script.
    Again, don't try to re-invent the wheel unless there is some benefit to it. From what you told us about your requirements, there isn't in your particular case.

  • I want to use hibernate with the tomcat

    I want to use hibernate with the tomcat server can it be possible and if yes then what is the stepwise way.
    Infact I know the java JSF but want to command on Hibernate plz help me.
    I'll be thankful to you.

    To be honest, I wouldn't even know where to start. Do you know what Hibernate does and how it works? Do you know how Tomcat works? All you'd need to do to combine those two would be to let Tomcat provide the DB connections for Hibernate, I suppose. Neither of those products are a topic of this board though.

Maybe you are looking for

  • APP (F110) SHOULD ALLOW TO BLOCK BUT NOT ALLOW TO UNBLOCK

    Hi Friends. Deepawali Wishes. I have one requirement in APP that should allow the user to block the documents which are free for payment(In editi payment proposal) but should not allow the user to unblock those documents which are blocked for payment

  • How to turn off programs running in the background in the background on iPad

    how to turn off programs running in the background in the background on iPad

  • APEX - Authorization Scheme

    Hi i have a app developed in apex.... i'm getting a problem because on the Authorization Scheme. i create a view in oracle that shows if certain user may run the app, however i can't put this working, on apex. I'm wearing a Authorization Scheme based

  • ASA5520 v7.2 - How disable VPN traffic?

    Hi to all, I have an ASA5520 with v7.2. I have read in the command reference that, by default, the security appliance allows VPN traffic to terminate on a security appliance interface. And here is my question: How can I disable that to filter the VPN

  • Create invoice without receipt

    Hi Financial gurus, In My project we dont maintain Inventory in Oracle. Will I be able to create supplier invoice and match to PO without receipt - (all are expense and asset items) Will it affect my accounting factor (like AP Accrual Account) becaus