Re: container - transaction tag

Presently all methods of an entity bean run in a transaction. As a result each
method locks the entity bean there by making it unusable by any other method.
I think to avoid this I would need to change the <trans-attribute> tag in ejb-jar.xml
from "Required" to "Never" for each method. Even after doing that, I get the same
effect.
My whole idea is to run each entity bean method outside a transaction context.
Can anyone please suggest me a way to do that .
Thanks in advance.

Deyan,
I used to think that having Required on Entity is mandatory.
Anyway, it would be interesting to hear the author.
Regards,
Slava Imeshev
"Deyan D. Bektchiev" <[email protected]> wrote in message news:[email protected]...
Hi Slava,
If the EJB has in "Exclusive" concurrency no one will be able to access
the instance anyway until the local transaction completes.
If the original post meant that the data was locked then either
suspending the local transaction or using a plain DataSource would solve
the data availability as it will only be locked by the DB until the JDBC
transaction completes which might be the same duration as the EJB
transaction (but just coordinated by the calling code) and then it would
be just coding overhead to get rid of the EJB transaction in the first
place.
Personally I prefer making all Entity EJBs "Required" and where I really
need separate transaction set to "RequiresNew". For Session EJBs it's a
different story and there "NotSupported" makes sense sometimes (we have
some session EJBs that can execute for 30 minutes or more and locking
too many resources for that long really takes the scalability away).
So the answer to the original issue might be to just set the concurrency
to "Database" or "Optimistic" and do findByPK from all of the other
threads that need to do the EJB access.
Plus the benefit of using "Required" with Weblogic is that should you
ever reenter (or access multiple times) your EJB you get the same
instance if you are running inside a transaction and the instance was
already part of it -- thus reducing stale data access.
Regards,
Dejan
Slava Imeshev wrote:
Hi Deyan,
That's all correct. Myself I'm wondering what "usability by any other method"
means in the original post. Knowing that we should be able to give a right
answer:
"As a result each method locks the entity bean there by making it unusable
by any other method"
Regards,
Slava Imeshev
"Deyan D. Bektchiev" <[email protected]> wrote in message news:[email protected]...
Well,
For Weblogic you still get a "local" transaction for the duration of the
EJB call whether you want it or not (if necessary it suspends any
current transaction before the call and start the "local" one).
You can play with the TransactionManager or the Weblogic TxHelper class
to suspend that transaction and then resume it at the end of the call
but if you are doing CMP then it could lead to data corruption.
A much cleaner way of doing this is to use a plain DataSource and not a
TXDataSource that doesn't care about any transaction already in progress
and the connections that you get from it are not transaction aware.
HTH,
Dejan
Mark Shaffer wrote:
I don't think I believe you, because the "Never" transaction attribute means that
not only will the container not create a transaction to invoke the method, it
will actually throw an exception if an attempt is made to invoke the method from
a thread with an existing transaction context.
Anyway. the "NotSupported" transaction attribute will cause the container to call
the method outside of any transaction context. If the calling thread has no existing
transaction then a new one will not be created, and if the calling thread has
an existing transaction then that transaction will be suspended while the method
is called.
Hope this helps...
Mark
"K W" <[email protected]> wrote:
Presently all methods of an entity bean run in a transaction. As a result
each
method locks the entity bean there by making it unusable by any other
method.
I think to avoid this I would need to change the <trans-attribute> tag
in ejb-jar.xml
from "Required" to "Never" for each method. Even after doing that, I
get the same
effect.
My whole idea is to run each entity bean method outside a transaction
context.
Can anyone please suggest me a way to do that .
Thanks in advance.

Similar Messages

  • How to display data containing CDATA tags in JSP/HTML?

    Hi,
    I'm getting some data from a webservice and displaying it in JSP. But some data from the service (like description of an item) contains CDATA tags.
    For ex: This is the data from the webservice.
    <BenefitsIssues><![CDATA[This strategy buys after a very rapid or extreme sell off with the hope that the gap will eventually be filled. <br>Typically, traders following these types of strategies expect some very large losses as downtrends continue.<br>Traders should take only very small positions when trading this strategy and never dedicate more than a small amount of risk capital in aggregate to this strategy.]]></BenefitsIssues>
    where <BenefitsIssues> is the XML tag. My code displays everything within this tag in JSP.
    Code is JSP looks like this.
    <tr><td><%=strategyDescriptor.getBenefitsIssues()%></td></tr>
    Eventually the HTML output of this JSP looks like..
    <tr><td>![CDATA[This strategy buys after a very rapid or extreme sell off with the hope that the gap will eventually be filled. <br>Typically, traders following these types of strategies expect some very large losses as downtrends continue.<br>Traders should take only very small positions when trading this strategy and never dedicate more than a small amount of risk capital in aggregate to this strategy.]]</td></tr>
    Problem is that the page fails to display the first line, "This strategy buys after a very rapid...." and starts displaying only from "Typically, traders following these....", i.e after the occurrence of first <br> tag. Page also displays "]]" at the end.
    How I can get rid of this problem? One way is to remove "![CDATA[" and "]]" from the data received from webservice. I would like to know if any other better solutions is there. Is there any predefined function to remove "![CDATA[" ?
    Thanks in advance for the help.
    -Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    write tha bean class with the return type like. vector,arraylist .
    add the result set values to vector.
    for example
    Vector s = new Vector();
    while(rs.next)
    s.add(rs.getString());
    at last return that s.
    return s;
    // IN Jsp page;
    <ur dropdown come here>
    <%
    Vector Test = new Vector();
    Test = call function contains databasevalues();
    for(int i=0;i<Test.size();i++)
    %>
    <option><%=Test.get(i)%></option>
    <%}%>
    %>
    Message was edited by:
    kamal_shan

  • Smartform with text containing html tags

    I am reading from a table that contains html tags like
    <br>
    <menu>
    <LI type="disc">This is a line which contains html tags
    that goes over to 2nd line
    <LI type="disc"> This is also another line which contains html
    tags.
    and each line is stored in a different row. The customer has agreed to use only 3 of the above html tags (
    <br>, <menu> and <LI type="disc">
    When the output is previewed in smartforms, the html tags needs to be formatted and not print in raw format as follows: 
    <LI type="disc">This is a line which contains html tags
       that goes over to 2nd line
    <LI type="disc"> This is also another line which contains html
       tags.
    How can this be done ?

    ok understood...
    you can try this
    Loop at i_html into wa_html.
    tmp = strlen( wa_html-line).
    do tmp times.
    if wa_html-line+0(1) = <
    l_start = 1.
    __elseif wa_html-line+0(1) = >
    l_start = 0.
    concatenate l_char wa_html-line+0(1) into l_char.
    endif.
    if l_start = 1.
    concatenate l_char wa_html-line+0(1) into l_char.
    wa_html-line = wa_html-line+1(l_tmp - sy-index) OR use the keyword SHIFT LEFT...plz chk the syntax
    elseif l_start = 0 and l_char = <LItype=disc>
    concatenate <BULLET>  wa_html-line into  wa_html-line separated by space.
    endif.
    enddo.
    modify i_html form wa_html.
    endloop.
    now u define two text element one with bullet and another without bullet. this is how u insert bullet:
    goto to the texteditor of a text element in smartform. Its a small button on the left hand side of.
    Then goto insert>characters>sap symbols.
    for ur requirement u can use the symbol SYM_FILLED_CIRCLE.
    Remember these icons or symbols whatever u will not be able to see in print preview....u have to take a print
    and see
    Now at the time of display check if the line contains the
    tag <BULLET> ( if wa_html-line+0(8) = '<BULLET>')
    if the line has the tag then display ur text in the text element with bullet
    otherwise
    display it in the non bullet text element..
    remeber to remove the tag before dispalying
    hope this solves ur prob...

  • Contains HTML tags & print

    Hi,
    Reports6i patch10
    Scenario is: I have a column (database colummn text with embedded HTML ) where I set property 'Contains HTML tags'
    I get the column incl html rendered find where desformat=html&destype=file&desname=myfile.html '
    but when setting
    destype=printer&desformat=html&desname=myqueue and sending output straight to printerqueue the html is not being rendered in fact the column is not rendered at all
    HAs anyone similar experience ? solutions ?
    TIA
    Per

    Hello Per Elmgreen,
    When DESTYPE is specified as PRINTER, Reports formats output in PS or PCL format (depending on the printer language understood by the destination printer). Since these formats do not understand HTML tags, any such markup in the output will remain unformatted.
    In order to get properly formatted output using HTML tags, you could generate the report to a HTML file (with the 'Contains HTML tags' property set) and then print the file using a browser.
    Thanks,
    The Oracle Reports Team.

  • Omitting container-transaction in ejb-jar.xml

    Hi,
    This may be an easy answer (although I'm struggling to find onejust now) but if you don't define a <container-transaction> element to the ejb-jar.xml for your EJBs, what transaction attribute is used when using Container Managed Persistence? Are transactions used at all it this scenario or does it default to auto committing after every statement?
    Also, what part does the application server vendor play in this - if any?
    Thanks in advance for any help on this topic.

    I'm still struggling to get a conclusive answer to this issue. Read a few books and the EJB spec itself but nothing seems to give an answer on this issue. This makes me think that it is up to the container if it is not defined.
    Also did some tests on Oracle 9ias and it seems that transactions aren't used when transaction config is not defined for CMT beans as it would only rollback on an error when it was defined. Still need to do some more tests.
    Again, if anyone is able to help shed some light on this then it would be much appreciated.
    Thanks.

  • How set autocommit=false with container transactions?

    Hi all!
    A'm using EJB's with transaction attribute=Container.
    This is simple scenario:
    call Session Bean
    begin transaction
    call EntityBean1 {
    database update 1
    call EntityBean2 {
    database update 2
    end transaction
    return from session bean
    The problem is:
    when update2 fails update1 not rolling back.
    A know, that solution of this problem is set AUTOCOMMIT=FALSE in Connection, but how do this with container transactions? Point me exactly to place, where this can be done, if this possible. Or may be no general solution (I.e. Each case demands it's own approach.)?
    (I can't directly call method of Connection object because of transaction managed by container)
    Tnx a lot.

    Hi there,
    I have the same problem with Orion and NuSphere MySql.
    When I define a container-managed transaction, the autocommit mode is not changed.
    I have a session bean for which I set the transaction attribute to REQUIRED and two entity beans for which the transaction attribute is SUPPORTS in the ejbjar.xml file.
    The session beans calls the two entity beans and makes some modifications on them like for instance removing them from the database.
    When I check whether a transaction can be rolled back, for instance by putting in my code a loop that never ends and then stopping the server, it seems my application is running in autocommit mode. No rollback is done.
    This is very strange.
    The two entity beans are stored using gemini tables which permit rollbacks. So when I start a transaction inside mySql using sql statements, I can do a rollback without problem.
    Any idea of what's going wrong ?
    Dimitri.

  • How to import photos containing a tag from elements?

    how to import photos containing a tag from adobe elements 8?

    Tags are keywords.
    Other metadata:
    There is no way to share Faces from one system to another. Places will happen automatically if your photos have the gps co-ordinates in the Metadata. Events are populted depending on the choices you make in the iPhoto Preferences.
    Again, I'm not sure exactly what you're hoping for here, sorry.

  • Problem trying to run compile jsp containing JSTL tags

    Hi,
    I am facing a problem regarding compiling jsp containing JSTL tags.
    Can anybody help me out?

    Yes it is giving an error when i try to compile the jsp.
    And it's giving error on the include of the taglib in the jsp as
    C:\dev\ppdev\DOMA\jspcompile\WEB-INF\jstl\c-rt.tld" is an invalid archive file!
    Actually we are not using th default entry for taglib. Instead we have made an entry in the web.xml. Like this
    <taglib>
    <taglib-uri>/WEB-INF/c.tld</taglib-uri>
    <taglib-location>/WEB-INF/jstl/c.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/c-rt.tld</taglib-uri>
    <taglib-location>/WEB-INF/jstl/c-rt.tld</taglib-location>
    </taglib>
    And using this uri in the jsp page like this
    <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
    <%@ taglib uri="/WEB-INF/c-rt.tld" prefix="c_rt" %>
    And when we try to compie the jsp its giving the error.
    C:\dev\ppdev\DOMA\jspcompile\WEB-INF\jstl\c-rt.tld" is an invalid archive file!
    I would appreciate your help and update me if any more information is required.

  • EJB module Editor - Container Transactions bug report

    When in "EJB module Editor" screen under the "Container Transactions" node following bugs happen:
    1) I click on the "Add..." button
    2) In the "Create Container Transaction Entry" screen I click on "Add method.." button.
    3) Once "Define Method Entry" screen appears, I first have to clic on space to see the list of available EJB's (I have 13 of them) as the screen does not display the list! (for this bug the easiest it would be to send you a screen shot so that you can see)
    4) After I selected the EJB I wanted, I choose "*" for all methods
    5) Once returned to the "Create Container Transaction" Screen I click "Ok' and I can see that my Entry was added to the "Container Transaction Entries" list
    6) I go the EJB I just added to the transction entries list, and select the "Methods" node and the frist selected methods will have the appropriate "Container Transaction" attribute set
    7) If I select a different method or simply go back the "Container Transactions" node the EJB in question is not on the "Container Transaction" list any more!!!

    Hi
    I just followed your steps to reproduce the issues reported. I cannot reproduce the refresh issue as you mention in Step 3, but am able to reproduce the issue mentioned in step 7.
    Logged bug 5124894 to track this issue
    Thanks for pointing this out
    Prasanth

  • Unknown assembly-descriptor subtag container-transaction

    I am getting this error message when I try to deploy my EJB application to 9iAS v2 via OEM. I can remove all "container-transaction" references from orion-ejb-jar.xml and deploy the app, then add the references later and it works just fine.
    Any ideas?

    Thanks Rob. That's what I was hoping to hear. I agree with you on the need
              to explicitly define the tx attribute. In the absence of any tools for
              validating the attributes, chances are that errors like these can go
              un-noticed and hence it helps to know the behavior upfront.
              BTW, it was nice meeting you at San Diego.
              Regards,
              Adarsh
              "Rob Woollen" <[email protected]> wrote in message
              news:[email protected]..
              > I believe it will default to NotSupported.
              >
              > That being said, I'd highly recommend that you always set a transaction
              > attribute explicitly instead of relying on container defaults.
              >
              > -- Rob
              >
              > Adarsh Dattani wrote:
              >
              > > In my WLS 6.0 ejb-jar.xml if I set the tx type to container
              > > <transaction-type>Container</transaction-type> ) and omit the
              > > <container-transaction> element within the <assembly-descriptor>
              element,
              > > how does the container handle the transaction within the onMessage
              method of
              > > my MDB ? Does it assume Required, NotSupported or neither ?
              > >
              > > --
              > > Regards,
              > > Adarsh
              >
              

  • How do I center a container div tag in Dreamweaver?

    Hi,
    I actually asked this question about another web page but for some reason setting the margins to "auto" on this one isn't working.
    Please help. Thank you.
    http://www.laurasummers.com/

    Thanks Nancy. I appreciate this. I do have another question, though. I did try to adjust the margins in my Dreamweaver body style sheet and it didn't seem to work. Do you know why this is?
    Also, I did add this code. It worked except that the "Laura Lee Summers" and the subtle wave imagery stay in place while everything else centers. The Laura Lee Summer and the wave image is in the container div tag so I am confused.
    Try this:
    body {
    width: 960px;
    position: relative;
    margin: 0 auto; /**this centers the page on screen**/
    background: #cdffff url(lsummers_images/laurasummers_bkgd_Final.jpg) top center no-repeat;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
    font-size: 14px;
    color: #111;
    line-height: 1.5;
    NOTE #1: font-size in points (pt) is for print only. For web pages displayed on screens, use px, ems or %.
    NOTE #2:  The site owner's name is the most important piece of information on the page, right?  It belongs inside the markup within <h1> tags.  Instead, you have put her name in a background image which will never be recognized by Google.
    SEO LINKS
    Google's SEO Starter Guide Updated 2010
    http://googlewebmastercentral.blogspot.com/2010/09/seo-starter-guide-updated.html
    High  Rankings Advisor
    http://www.highrankings.com/newsletter/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • MDB container transaction

              Hi,
              I had a MDB running quite happily to check for database changes. Because the MDB
              deleted entries form a log table when it had read them I added a container managed
              transaction for the onMessage function. Now I keep getting a Warning message:
              Message Driven Bean 'UpdateCheck' is transacted but the provider defined in the
              ejb is not transacted. Provider should be transacted if onMessage method in MDB
              is transacted.
              I cannot find out what the "Provider" referred to is. I have used the default
              ConnectionFactory - do I need to create my own to enable transactions?
              Peter.
              

    The provider in this case is JMS, and for whatever reason it is not capable of using
              transactions.
              If you are using WL JMS, just don't specify a
              ConnectionFactory inside the descriptor files so that the MDB uses the
              default WL MDB connection factory. If you insist on specifying a connection
              factory, ensure it is one that has "user transactions enabled".
              If you are not using WL JMS, that is whole new ball of wax. Look for
              the white-paper on integrating foreign JMS providers on dev2dev.bea.com
              for answers.
              Tom
              Peter Hughes wrote:
              > Hi,
              > I had a MDB running quite happily to check for database changes. Because the MDB
              > deleted entries form a log table when it had read them I added a container managed
              > transaction for the onMessage function. Now I keep getting a Warning message:
              >
              > Message Driven Bean 'UpdateCheck' is transacted but the provider defined in the
              > ejb is not transacted. Provider should be transacted if onMessage method in MDB
              > is transacted.
              >
              > I cannot find out what the "Provider" referred to is. I have used the default
              > ConnectionFactory - do I need to create my own to enable transactions?
              >
              > Peter.
              

  • Container transaction NOT rolled back after a long period of time.

    Hi, I am using Weblogic 6.1SP5 on RedHat 7.1 and I have seen an unexpected
              behaviour with an MDB and I would like to know if there is any circumstance
              in which a transaction is not rolled back automatically by the container
              after the transaction timeout specified on MDB descriptor expired.
              The fact is I have seen a thread locked for 3 entire days without any
              exception being raised (the trans timeout was set to 900 seconds for
              debugging porpouses)
              Sadly I didn't thought on issuing a ps -ax and a netstat -np in order to see
              if there was any connection active for any of the JVM threads.
              As an aside note I had to throw a kill -9 to Weblogic's JVM in order to
              completely stop it because using the standard "stopWeblogic.sh" script it
              got stalled.
              The only unusual thing that I can think of the MDB is doing is opening a
              connection against a remote system via a socket.
              My question is. Is it possible that a thread locked on I/O (in this case a
              socket) to be out of control in terms of throwing at it a "Transaction
              rolled back exception"?
              I have modified my code in order to set SO_TIMEOUT on the socket just in
              case the other peer hangs and never returns control. But I would like to
              know the problem could be there.
              I know for sure that at the time the thread stalled the other peer died
              (exceptions on other MDBs trying to connect to remote system) but I expected
              a "socket exception" to be thrown by the O.S. to the stalled thread instead
              of having the thread waiting forever on that "open" socket.
              Thanks in advance.
              Ignacio.
              

    While a tramsaction may be rolled back at the transaction timeout,
              the thread is not stopped. The actual exception won't occur until
              the MDB completes. If the MDB doesn't complete (as in this case),
              you won't get the exception.
              "Ignacio G. Dupont" <[email protected]> wrote in message news:[email protected]...
              > Hi, I am using Weblogic 6.1SP5 on RedHat 7.1 and I have seen an unexpected
              > behaviour with an MDB and I would like to know if there is any circumstance
              > in which a transaction is not rolled back automatically by the container
              > after the transaction timeout specified on MDB descriptor expired.
              >
              > The fact is I have seen a thread locked for 3 entire days without any
              > exception being raised (the trans timeout was set to 900 seconds for
              > debugging porpouses)
              >
              > Sadly I didn't thought on issuing a ps -ax and a netstat -np in order to see
              > if there was any connection active for any of the JVM threads.
              >
              > As an aside note I had to throw a kill -9 to Weblogic's JVM in order to
              > completely stop it because using the standard "stopWeblogic.sh" script it
              > got stalled.
              >
              > The only unusual thing that I can think of the MDB is doing is opening a
              > connection against a remote system via a socket.
              >
              > My question is. Is it possible that a thread locked on I/O (in this case a
              > socket) to be out of control in terms of throwing at it a "Transaction
              > rolled back exception"?
              >
              > I have modified my code in order to set SO_TIMEOUT on the socket just in
              > case the other peer hangs and never returns control. But I would like to
              > know the problem could be there.
              >
              > I know for sure that at the time the thread stalled the other peer died
              > (exceptions on other MDBs trying to connect to remote system) but I expected
              > a "socket exception" to be thrown by the O.S. to the stalled thread instead
              > of having the thread waiting forever on that "open" socket.
              >
              > Thanks in advance.
              >
              > Ignacio.
              >
              >
              

  • JMS publisher inheriting EJB container transaction

              I have trawled through the archives but just need to clarify :-
              How can I have an Session EJB which send messages to a JMS Queue inherit the EJB
              container managed transaction from the session bean, such that if the EJB rollsback
              the message will as well ?
              1) Firstly is this possible with container managed transactions ?
              2) Should I use a transacted (true) or non-transacted (false)
              Session ?
              queueConnection.createQueueSession(true,0); or
              queueConnection.createQueueSession(false,0); or
              3) Unless I call queueSession.commit() the message never seems to get there, but
              if I call commit() it seems to arrive at the MessageDriven bean IMMEDIATELY, i.e
              before the Session bean's transaction has committed. Do I need to commit() ?
              Any help would be appreciated.
              I have tried
              

              Pete wrote:
              > I have trawled through the archives but just need to clarify :-
              >
              > How can I have an Session EJB which send messages to a JMS Queue inherit the EJB
              > container managed transaction from the session bean, such that if the EJB rollsback
              > the message will as well ?
              >
              > 1) Firstly is this possible with container managed transactions ?
              Yes.
              > 2) Should I use a transacted (true) or non-transacted (false)
              > Session ?
              >
              > queueConnection.createQueueSession(true,0); or
              > queueConnection.createQueueSession(false,0); or
              >
              non-transacted, otherwise you will get the behavior in (3)
              ensure that the connection factory used has the
              "UserTransactionsEnabled" flag configured to true
              > 3) Unless I call queueSession.commit() the message never seems to get there, but
              > if I call commit() it seems to arrive at the MessageDriven bean IMMEDIATELY, i.e
              > before the Session bean's transaction has committed. Do I need to commit() ?
              >
              > Any help would be appreciated.
              > I have tried
              This is a frequently-asked question. See the JMS FAQ for details, also
              check out the tranaction chapter of the JMS programmer's guide, and, if
              your interested in performance considerations, check out the WebLogic
              JMS Performance Guide white-paper available on dev2dev.bea.com.
              

  • Okc/okx table that contains Transaction Type from the pricing/billing tab

    We are running 11.5.9 EBS, and the module is Service Contracts Authoring.
    I have a sql script that pulls data from the header and subline level for service contracts. If possible I would like to get the Transaction Type form the Pricing/Billing Tab. Summary > Pricing/Billing - submenu "Billing". I have not been able to find a table in OKC or OKX that contains this Transaction Type ID which can be tied back the cust_trx_type_id in the AR.RA_CUST_TRX_TYPES_ALL and in turn get the NAME for the transaction.

    I'm not sure where the cust_trx_type_id would be stored in OKC/OKS tables, but the table OKS_BILL_TRANSACTIONS stores the trx_number that you can link to ra_customer_trx_all and get the cust_trx_type_id.
    HTH
    Alka

Maybe you are looking for