Using Session Beans on a read only database

Hi,
i am working on a weblogic 6.1 server and have to access a read only database
using session beans. The transaction attributes of all session beans (we are using
no entity beans) are set to NOT_SUPPORTED but every time a method is accessed
an error message is thrown
BEGIN TRANS in read only database .....
Is there a way to avoid this?
Regards
Edmund

I guess it is NotSupported. If not try Never.
--Jay   
www.architectslobby.org
An exclusive community for Enterprise Architects

Similar Messages

  • Is it possible to connect database using session bean

    Dear all,
    Is it possible to connect database using session bean without using entity beans like cmp,bmp.
    if ur answer is yes, then pls tell me where to put the select statement and transaction attribute like(6 types).
    if u have sample code, then it is good for me.
    Hope I will get answer.

    Sure it is.
    Try something like this (and maybe get a book on JDBC):
    String name;
    try {
         InitialContext ic = new InitialContext();
         DataSource ds = (DataSource) ic.lookup(Constants.MY_DATASOURCE);
         Connection connection = ds.getConnection();
         String sql = "SELECT * FROM TABLE";
         PreparedStatement statement = connection.prepareStatement(sql);
         ResultSet rs = statement.executeQuery();
         while (rs.next()) {
              name = rs.getString("NAME");
         if (rs != null)
              rs.close();
         if (statement != null)
              statement.close();
         if (connection != null)
              connection.close();
    catch (NamingException e) {
         // Can't get JDBC datasource
         // ... do something with this exception
    catch (SQLException e) {
         // SQL exception from getter
         // .... do seomthing with this one too
    }

  • Can I connect with Database using Session Bean

    Hi,
    I am new to EJB. I have small doubt.
    can I connect with Database using Session Bean.
    Regards,
    Murali.

    Double post of http://forum.java.sun.com/thread.jspa?threadID=687239&tstart=0

  • Using BC4J on a read-only database?

    Is it possible too configure BC4J to run against a read-only database?
    I only have query-based view objects (no Entity objects) and the data is updated by another application. The user I use to atatch to the DB only has read-only access, and when trying to run my BC4J app I get the following errors:
    Error Message: JBO-28006: Could not create persistence table PS_TXN
    Error Message: ORA-01950: no privileges on tablespace 'USERS'
    Is this PS_TXN table required even if I only want read-only transactions?
    thanks
    Brigette

    Thanks Shay,
    In conjunction with http://otn.oracle.com/products/jdev/howtos/bc4j/howto_dynamic_jdbc.html (which showed me how/were to set the property), this has solved the problem!
    keep smiling
    Brigette

  • Should I rebuild my read only database every time I launch my server?

    I'm getting into web development, and I'm trying to get a grip on databases.
    In an app I want to make, there is a read only database that will be filled up with a large amount of data, which will be the heart of the application, and also a lot of work to put in.
    I'm uncomfortable with putting all this data into the database, as the database is "separate" from my web app code. I feel like I should rather write my data in code somewhere, and then have my application put the data into the database for me.
    This way I would have my entire project written in code, and not an integral part of my software hidden away in the database, which is a bit complicated to work with, and seems difficult to move from computer to computer.
    But is this a sensible way to do this, however? Should I write my data in code, and every time I launch the server, make the application drop all the tables and read them in from my code again?
    Is this the wrong way to go about it? Would it cause considerable overhead? How do people do this?

    Why are you uncomfortable in separating the data into a database? Don't you follow a modular approach when it comes to coding and separate the UI layer and the business layer? The data you are referring to, that many legacy applications will have at least
    some of it embedded in the code in the form of constants, is an ideal lookup table data that should be stored in a database. 
    >>>"This way I would have my entire project written in code, and not an integral part of
    my software hidden away in the database, which is a bit complicated to work with, and seems difficult to move from computer to computer."
    You can locate your database centrally and connect to it from any computer. The maintenance of your read only data in your DB is much more easier than embedding it in
    the code
    >>>"Should
    I write my data in code, and every time I launch the server, make the application drop all the tables and read them in from my code again?"
    This is totally unnecessary. If you will be entering a lot of read only data into your DB, you can have
    a small utility program that provides an interface to enter the data into a DB - if you are uncomfortable with using the SSMS UI or TSQL to enter the new data. Also, reloading the data every time will only make your application look very slow and unacceptable. 
    To summarize, store your data in a DB. Even it if is small application, you can start with SQL Express
    edition to store the data as you will most likely need a proper DB in future if not now as your application functionality grows.
    Satish Kartan www.sqlfood.com

  • Run Preclone merge in read only database

    HI ,
    I have a production database is reserved for normal clone ( multi node clone ) . I have a new assignment that need to merge a appltop for a single node clone . so we choose a DR database as source , which is a read only database . When I run perl adpreclone.pl merge and enter apps password It return “ORA-01033: ORACLE initialization or shutdown in progress
    Is any have any idea how to get around this problem so that I can continue my preclone merge ?
    Thanks
    Felix

    This is DR site . It is a data guard server . so this database is not open . Below is messgae I get .
    /oracle/prod/db/prodcomn/admin/scripts/PROD_usla1-vts-mgr-1$ perl adpreclone.pl appsTier merge
    Running adgenhfver.pl with command...
    perl /oracle/prod/db/prodappl/ad/11.5.0/bin/adgenhfver.pl isPrimary=y applsysusr=APPLSYS tempdir=/oracle/prod/db/prodcomn/temp
    Please enter the APPS User [APPS]:
    Please enter the APPS password: XXXXXXX
    This is the merge Primary node:
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    Do you have any idea how do I get around this problem so that I can finish preclone ?
    Thanks
    Felix

  • Scheduling workbooks in read only database

    We have a standby server for our OLTP and it is read only database. Read only database is not allowing to schedule discoverer reports. Can anyone suggest how to handle this?

    Its a replication of OLTP. Every day night OLTP logs are applied into this read only database. We cannot change anything in EUL. Whatever the changes we do in OLTP EUL it gets reflected in the read only database.

  • Why r we not use tablespce begin backup with read only tablespace

    why r we not use tablespce begin backup with read only tablespace

    Please learn English prior to posting. The schools in India are not that bad!
    Please RTFM.
    Please stop asking doc questions at lightning speed.
    Please go figure
    Sybrand Bakker
    Senior Oracle DBA

  • Backing Up Read-Only Databases

    Below Link looks like applies to SQL2008 and 2008R2, 
    https://technet.microsoft.com/en-us/library/ms190374(v=sql.105).aspx 
    Will that be the same case for all the SQL2012 also ?
    Thanks in Advance.
    Regards,
    Ram.
    ramakrishna

    https://technet.microsoft.com/en-us/library/ms190374(v=sql.105).aspx 
    Will that be the same case for all the SQL2012 also ?
    Hi Ram,
    Yes. It will be the same case for SQL Server 2012. For more details about
    backing up Read-Only databases in SQL Server 2012, you can also review the following articles.
    Partial Backups (SQL Server)
    https://msdn.microsoft.com/en-us/library/ms191539(v=sql.110).aspx
    Differential Backups (SQL Server)
    https://msdn.microsoft.com/en-us/library/ms175526(v=sql.110).aspx
    Thanks,
    Lydia Zhang
    Lydia Zhang
    TechNet Community Support

  • Example of using session bean with webservices

    Hello,
    I am working with netbeans 5.5 (with JAX-WS 2.0 library) and using Tomcat.
    I have created webservices and everything is working well so far. However, each webservice is making a connection to my database.
    I would like to use a session bean so that I make the connection only once (at the begining of the client session for example) and store it into my session bean.
    I am a newbie in those things, I search on the Web and on this forum some code examples. The only thing I have found is this article http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html
    When I tried this, the session doesn't seem to work at all : I get the same result (counter=1) twice.
    Does anybody have a complete example of how to use a session with webservices please?
    Thanks a lot!

    Sorry, I was not very clear in my last message.
    I need all my webservices to share the same bean during one user session.
    Then, if a page calls 2 different web services, only 1 database connection is made instead of 2. And if the user opens other pages which call other webservices, they will use the connection kept into the session bean.
    Anyway, I tried to do like it is said in your website but I can not build my project. I have an error : java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/.../build/web/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. I do not understand because I have downloaded the jax-ws 2.1.1 api and no other libraries are imported in my project. :-(
    I wonder if it is not related to netbeans...

  • How can i design a EJB application using session Beans?

    Hello,
    I am designing a Find application using EJB. Here a user is prompted a search page, where he can enter the search criteria's. Then on click of submit, the query is formed at the server side depending on what criteria's were selected. Then a jdbc query is performed and the results are returned back to the user. Here no session is maintained for the users. Can anyone suggest me how to design this application using EJB. Should i use entity beans for this or session beans will suffice? Should the jdbc query be performed in the bean itself or should it be outside in a helper class? Please kindlu suggest me the design for this application...
    Regards,
    Subbu

    Hi,
    First of all, I'm unable to figure out why you need to use EJB for this scenario. You can write a helper class to frame and execute the query.
    If you really want to use EJB, then I suggest you use a stateless Session Bean with transaction attribute as TX_NOT_SUPPORTED. From the session bean, you can call the helper class. But, by avoiding the session bean, you can eliminate remote calls, thus improving your performance. Also, check if the database & the db driver you are using supports sql caching.
    Regards,
    Raj.

  • Session state protection and read-only items

    I have a requirement to create a report + form for a database table. In the form, there is mandatory database column that needs to be displayed but it should be read-only and its value derived using values entered elsewhere on the screen.
    It tried Display Only, Read Only and Disabled but they either fall foul of session state protection violation or ORA-01400: cannot insert NULL. The best method that I've found was to add readonly="readonly" the item element, but this causes the input item to lose its APEX classes and I'd prefer a declarative solution anyway.
    Anyone know the best approach?
    I've created a DEMO - http://apex.oracle.com/pls/apex/f?p=READONLY - which demonstrates the 4 methods.
    Edited by: KGelling on 17-May-2012 06:10

    KGelling wrote:
    The best method that I've found was to add readonly="readonly" the item element, but this causes the input item to lose its APEX classes and I'd prefer a declarative solution anyway.Looks like a bug to me. However a possible explanation/justification for this behaviour is that the HTML Form Element Attributes are often used to specify a custom class for the item, so the default class is removed to prevent any conflicts. IMO APEX needs to provide declarative support for the use of multiple, space-separated class values in page, region, item etc attributes.
    As a workaround in this case, just include the class in the HTML Form Element Attributes:
    class="number_field" readonly="readonly"
    I've created a DEMO - http://apex.oracle.com/pls/apex/f?p=READONLY - which demonstrates the 4 methods.
    Thanks for making the effort.

  • Help needed: clarifying the use of beans to pass data from database to JSP

    Hi everyone,
    I am sure you all get fed up with being asked this question as I can see it is asked a lot when googled, but the answers given have not cleared things up for me.
    Anyway, I have a JSP page that contains a text box, submit button and a select box of size 10. The user enters a search string and the form submits the data and reloads the same page. From the code you can see the Name property of the bean is set.
    <jsp:useBean id="vtm" class="FinalYearProject.Types.VtmType" scope="page" />
    <jsp:setProperty name="vtm" property="NM" value="${param.NM}" />I then need to be able to use that name to query a postgresql database. I have a JDBCConnector class with the method:
        public ResultSet searchTable(String NM ) throws SQLException {
            String[] names = NM.split(" ");
            NM = "";
            for(int i = 0; i < names.length; i++) {
                NM = names[i] + "%";
            return stat.executeQuery("SELECT * FROM vtm WHERE nm ILIKE '" + NM + "';");
        }This method however can be changed.
    My question really is what is the best way for me to take the name, get the resultset and pass back the VtmType objects to the jsp so that I can populate my select box, and where should each part be handled i.e. the JSP page, the VtmType, the JDBCConnector.
    I may be going about it completely the wrong way and using beans incorrectly, but I just cant seem to get my head around the problem.
    Any help would be much appreciated,
    Thanks.

    Hi,
    Thanks for the help, I actually found some literature about the JSP Model 2 and realised that was what I needed to do. I have now re-written everything and it has made my life a lot eaiser, typically this was before I checked back on this post though!
    Anyway, I now have JSP pages requesting Servlets which create beans and call classes that access the database. The servlet then forwards the beans and where necessary a small of html to another JSP. Like you have suggested.
    One problem I have now however, is that the user needs to be logged in to access some of the pages. An error page with the correct message is displayed to the user when it is processed via the servlet.
    //Servlet detects an error
    request.setAttribute("errorMsg", "1");
    gotoPage("/loginError.jsp", request, response);
    //JSP detects which errorMsg to display
    <c:set var="errorMsg" value="${requestScope.errorMsg}" />However, when the user does not sign in and clicks a link which is blocked the JSP forwards directly to the error JSP.
    //Tests to see if user is logged in
    <c:if test="${empty user.username}">
        <jsp:forward page="/loginError.jsp">
            <jsp:param name="errorMsg" value="3" />
        </jsp:forward>
    </c:if>The problem with this is that the only way I can see of checking the errorMsg type is with:
    //JSP checks which errorMsg to display
    <c:set var="errorMsg" value="${param.errorMsg}" />Which is different to how I determine the errorMsg from the Servlet. Is there a way of getting the errorMsg type that is the same for both actions?
    Thanks.

  • Using iTunes Library with a read-only account...

    Hi! I use my HD connected to my AEBS and to create some accounts in which people can use information on the shared folder that is created when the account preference is chosen. I later copied my iTunes library in the same folder so that everybody had access to it. Most of the users I created have restricted access (meaning read-only access). The ones that have full acces had no problem but the ones that have read-only access, when they try to choose the iTunes library, recieve a message saying "The folder "iTunes" is in a locked disk or you do not have write permissions for this folder.". I clearly understand what the problem is and why it is not letting those users acces it but does anybody has an idea on how I can make the iTunes library accessible to the "read-only users"? Thanks!

    Hi! I use my HD connected to my AEBS and to create
    some accounts in which people can use information on
    the shared folder that is created when the account
    preference is chosen. I later copied my iTunes
    library in the same folder so that everybody had
    access to it. Most of the users I created have
    restricted access (meaning read-only access). The
    ones that have full acces had no problem but the ones
    that have read-only access, when they try to choose
    the iTunes library, recieve a message saying "The
    folder "iTunes" is in a locked disk or you do not
    have write permissions for this folder.". I clearly
    understand what the problem is and why it is not
    letting those users acces it but does anybody has an
    idea on how I can make the iTunes library accessible
    to the "read-only users"? Thanks!
    iTunes was NOT built for multi-user "write" access. Allowing write access to more than one user of iTunes "concurrently" is a recipe for disaster: sooner or later your iTunes database will get corrupted. You have been warned.

  • ClassCastException while using session bean in OC4J

    I am facing the same problem while deploying a stateless session bean in Oracle 9i AS 1.0.2.2.1. The details are given below.
    The following code snippet is used in the client to prepare for the lookup:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    //the following line can also have the actual machine name instead of "localhost"
    env.put(Context.PROVIDER_URL, "ormi://localhost:23893/myejbs");
    Context ctx = new InitialContext(env);
    System.out.println("Getting Home....");
    Object obj=ctx.lookup("Grouping");
    System.out.println("Home Object Is : "+obj);
    GroupingHome groupingHome = (GroupingHome)obj;
    System.out.println("Got Home");
    Grouping grouping = groupingHome.create( );
    graphs=grouping.<mehtods>();
    I've edited the config/server.xml file to have the following line:
    <application name="myejbs" path="C:\oracle\ora102\j2ee\home\applications\classes\myejbs" auto-start="true" />
    which points to the directory where the class files reside
    I've also change the port in the config/rmi.xml file to 23893.
    Now... the problem that I am facing is - while I am running a client from outside the server JVM i.e standalone client... which uses the Grouping interfaces, it works fine. giving me the desired result. But the moment I place the code in a service client deployed in the server or a jsp, I get a ClassCastException for GroupingHome whereas the SOP that I have given after lookup shows that I have found - "Grouping EJBHome". The funny thisng is that bith the working client and the JSP are using sme set of interface class files - Grouping.class (Remote) and GroupingHome.class.
    Where am I going wrong?? If anybody knows, or Giri has found an answer to his query... please post a reply.
    Thanks.
    PS: I've tried new InitialContext(); solution but it didn't work. I have also narrowed the home object with javax.rmi.PortableRemoteObject.narrow(obj,GroupingHome.class) but to no avail :(.

    Hi Gauarv,
    Did you not see my reply in the following post?
    Re: 502 service temporarily unavailable
    If I'm not mistaken, this is exactly the same question as you asked
    there.
    By the way, is there some reason you are still using OC4J version
    1.0.2.2? Is there something stopping you from upgrading to the later
    versions (9.0.2 and 9.0.3)?
    Good Luck,
    Avi.

Maybe you are looking for

  • Cords Required to Watch Macbook Pro on TV

    I have the a Macbook Pro that I purchased in August of 2009. I purchased the 13 inch model, but with the 15 inch tech specs. I have an Emerson 32 inch LCD tv and I was wondering what cords I would need to watch movies on the TV via my Macbook Pro. Th

  • PDF Forms filled out don't display on Ipad2

    I use Dropbox to organize many of my files.  Some of those files are PDF forms that have been filled out.  They display correctly on my PC and my android phone.  However, they show up as blank forms on my Ipad2.  Why?  I have tried GoodReader, Dropbo

  • I have trouble connecting a Headset with the Speck Candyshell case installed

    I have a iPhone 4 with aCandyShell case. I do not like the headset that comes with the iPhone as it hurts my ears, and while I can plug in that headset with the CandyShell installed I would like to use a different headset... ideally a Sony MDR V300 t

  • Change data source - mail merge

    I have a mail merge document which was migrated to a new server. Now every time when I run the mail merge document it tells me "Error has occurred: The Microsoft Access database could not find the object '   '. Make sure the object exists and that yo

  • Office Pro 2010 Product Activation Issue

    Started getting errors when opening Office applications stating "product activation required". This product has been in use (activated) for some 3 or 4 years now and the product ID displays as installed. The Office product has been in use since purch