Inside SessionBean, an Entity and direct queries
Hi everybody,
Look at this example:
I already have a javaBean (simple, not enterprise) that updates an inventory table. I have to pass a java.sql.Connection as parameter.
I also have an EntityBean that put an order. Of course, i dont have to pass any Connection, because the EJB retrieve it from the container.
Now, I want to have both funcionalities in a single SessionBean stateless inside the same transaccion. Obviously, both, the JavaBean and the EntityBean, have to share the same DB Connection.
Is this possible???
Thanks in advanced
Iv�n.
Greetings,
Hi everybody,
Look at this example:
I already have a javaBean (simple, not enterprise)
that updates an inventory table. I have to pass a
java.sql.Connection as parameter.
I also have an EntityBean that put an order. Of
course, i dont have to pass any Connection, because
the EJB retrieve it from the container.
Now, I want to have both funcionalities in a single
SessionBean stateless inside the same transaccion.
Obviously, both, the JavaBean and the EntityBean, have
to share the same DB Connection.Erm, why do they have to share the same connection?? This is actually a 'transaction model' issue and not a database one... When dealing with stateless (poolable) session beans the thing to remember is that a transaction context exists within the bean only for the life of a single method call. As long as your slSB is calling on both the JavaBean and the Entity Bean within the same method call then your database accesses will share the same transaction - erm, depending, of course, on the transaction attributes assigned to your Entity Bean.
Is this possible???Sharing the DB connection? Erm, yes, but not really... You can write your EBs business methods to accept a Connection but this will create more headaches than it's worth since, as you rightly pointed out, the bean must be able to get it's own connection as part of the Container's management of it. If you REALLY need to share the same DB connection between JB and EJB then you may want to consider implementing the EJB functionality in a session bean - though, of course, this negates the benefits of using Entity Beans...
Thanks in advanced
Iv�n.I hope this is helpful.
Regards,
Tony "Vee Schade" Cook
Similar Messages
-
My Macbookpro has turned into microsoft windows and lost all data, how do I recover it with my windows 7 still inside? I accidentally install directly, Help please...
ok turn it off manually and turn it back on while holding the apple logo bottor or the function botton this will give you an option to choose if you want to startup with osx ow windows. let me know if this works
<Email Edited By Host> -
Error: Common entries are not permitted for plan queries and input queries
Hi,
I have a 2 selections in the column struct:
1. year = 2005, version = actual
2. year = 2006, version = plan, marked as data can be changed using user entry or planning function
row has posting periods from 1-12
in the workbook I have inserted this query in the workbook in analysis grid. it runs good.
now i added a button and assigned planning function to it. this planning function copies 2005, actuals to 2006, plan.
when i execute the workbook and hit this button, it gives me following error:
"Common entries are not permitted for plan queries and input queries"
please can anyone provide me assistance with this issue.
thanks,
samwhen i go to diagnosis it displays following:
Diagnosis
InfoProvider ZIP_PLAN2 must be described in this application by both a plan query and by a input-ready query, which is directly defined on the InfoProvider ZIP_PLAN2.
System Response
This is not permitted. -
I get an error message when trying to
execute the instructions bellow
create table publications
public_id number,
title varchar2(200),
constraint publications_pk
primary key(public_id)
create table profiles
profile_id number,
rule varchar2(500),
constraint pro_pk
primary key(profile_id)
I create a ctxrule index
create index profile_index on profiles(rule)
indextype is CTXSYS.CTXRULE;
I issue queries like this one
select profile_id from profiles
where (matches(rule,' etc .. ')>0)
or (title_rule is NULL)
or like this
select profile_id from profiles
where (matches(rule,' etc .. ')>0)
and (profile_id<10)
and get the error
ERROR at line 1:
ORA-20000: Oracle Text error:
DRG-50610: internal error: MATCHES does not support Functional InvocationActually the error only happens when this query
is issued inside a cursor loop and a stored procedure
like this one
create or replace procedure match(doc_num in number) as
document publications%rowtype;
begin
select * into document
from publications
where public_id=doc_num;
for matched_profile in (
select profile_id from profiles
where (matches(rule,document.title)>0)
and (profile_id<10)
loop
/*Other Code to type the matched profile*/
end loop;
end;
The code is syntactically correct
but causes runtime error.
The version of Oracle is use is 9.2.0.1 -
Prompts on reports build on direct queries to the database
Hi,
Is there a way to create prompts to reports that have been built based on direct queries to the database rather than using a cube?
I did not find a way to do it, maybe it is not possible at all?
Regards
Giulianook. lets go step by step.
im assuming that you know how to create a prompt. in the prompt add all the column you wanted i.e
a.resv_status,a.begin_date,b.last
select control as "Drop Down list". leave "Show" and "Default to" as defaults. in the set variable select presentation variable and type some name. so lets assume for
1, a.resv_status variable is resv_status_var
2, a.begin_date is begin_date_var
3, b.last is last_var.
save the prompt.
now your query is
select distinct c.room, b.last, b.first, a.resv_status,a.confirmation_no, a.begin_date, a.end_date,d.departure_date as last_stay
from reservation_name a, name b, reservation_stat_daily c,stay_records d
where a.name_id=b.name_id
and a.name_id=c.name_id
and c.name_id=b.name_id
and a.resort=c.resort
and a.resort=b.resort_registered
and a.confirmation_no=d.crs_book_no
and a.resort=d.resort
and a.resv_status= '@{resv_status_var}{02}'
and a.begin_date = '@{begin_date_var}{02}'
and b.last = '@{last_var}{02}'
where 02 is the default value. you can change it as you want. now save the report. go to a dashboard page and add the prompt and report you created in to a same page. now changing the values in prompt will change the report. -
Mixing traditional and recursive queries
Hello,
I'm trying to solve this problem on a single SQL statement but I haven't been able to do it. Let me explain.
I've a plain table where I'm doing a single select without problems.
There is another recursive table that is used to retrieve the hierarchical structure for a selected key item that is used as a START WITH clause.
The problem appears when, for each record selected on first query, I would like to retrieve the leaf records for it's structure.
I assume that if I can use the key value obtained from the first query as a START WITH clause on the recursive on I'll get the required information.
But I don't know how to do it.
Are there anyone that can help me?
Thanks.Hi,
Thanks for posting the sample data; that's exatly what poeple need to help you.
user12132557 wrote:
If I launch SELECT ID,DESCRIP FROM ITEMS WHERE YEAR >= 2005
I'll get last 3 records.
For each one I would launch a select like
SELECT ITEM,DESCRIP FROM TREE
START WITH ITEM=+column_id_last_query+
CONNECT BY PRIOR ITEM = PARENTIt's fine to describe the results you want, but there's no substitute for actually posting the results you want.
Is this what you're trying to produce, given the data you posted and the input parameter 2005?
` PARENT ITEM DESCRIP
5 50 Item 50
51 53 Item 53
51 54 Item 54
51 55 Item 55Whenever you post formatted text (such as query results) on this site, type these 6 characters:
\(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
One way to get the results above in Oracle 9 is:SELECT *
FROM tree
WHERE item NOT IN (
SELECT parent
FROM tree
START WITH parent IN (
SELECT id
FROM items
WHERE year >= 2005
CONNECT BY parent = PRIOR item
Unfortunately, I don't have an Oracle 9 database, so I have to test it on a higher version. I don't believe it uses any features that aren't available in Oracle 9. In particular, it uses a clumsy and inneficient sub-query in the main WHERE clause instead of CONNECT_BY_ISLEAF, since that pseudo-column was only introduced in Oracle 10.
Finally, I would like to know if this could be done in a single SQL query.Do you mean can it be done without sub-queries? No, I don't think so.
By the way, I'm using Oracle9i. I tagged my first post with this label. On next posts I'll write it in the text.Good move; there's an excellent chance that people won't notice the tags. Post the full versions, e.g. Oracle 9.2.0.2.0. Sometimes the finer divisions are significant. -
in app purchase from OMGPOP "Draw Something" of 400 coins never received - has anyone else had this problem and do you have a suggestion for me Tried "report a problem" and directed to this site."
Hi AP_In_Surbiton,
I am really sorry that you have had so much trouble getting your Caller ID up and going. I'll be happy to help you out with this and get it working for you.
Could you drop me in an email please? Use the 'contact us' form in my forum profile under the 'about me' section. You can find it by clicking on my username.
Thx
Craig
BTCare Community Mod
If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)”
td-p/30">Ratings star on the left-hand side of the post.
If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’. -
PLSQL Blocks and SQL Queries in APEX
Hello,
Is it possible at all to view undelrying Oracle PLSQL and SQL queries in a run time APEX 3.2 application?
More elaboratively, can a smart APEX Site user or visitor find a way to see underlying SQL queries and PLSQL code objects?
Thanks,
RHi,
If you just want to see what sql is executed by a session you can use sql trace. This can be switched on for a whole system but is usually more usable when switched on for individual users. The problem with a system like APEX is that database sessions are not directly associated with APEX users and APEX sessions can share database sessions.
I haven't tried it, but one method that may work is to put a schema logon trigger on the APEX_PUBLIC_USER which switches on tracing when ever this user logs on to the database. It may take a little detective work to understand the sequence of things but all the SQL executed by this user will be recorded and can be analyzed for performance etc. The command to enable SQL tracing could be embedded in the APEX app, but it may be a little random as to which db session has it enabled.
Perhaps a better tracing option could be seen as a feature request in a future version of APEX.
Regards
Andre -
Difference between ACH, Wires and Direct Debit
Can anyone tell me the difference between the following:
ACH
Wires
International Wires
Direct Debit
What is the additional configuration required from a functional consultant apart from setting them up as a payment method. Please help with all steps. and what inforamtion shouldbe requested from bank in order to set a data flow to and from the bankHi,
ACH - A provider of electronic funds transfer services in the United States, handling automated payments such as direct debit and direct credit.
Companies that use ACH send a DME file with information about the payments to be made. ACH then carries out the payments for them.
Direct Debit - Payment of an agreed amount that is collected from a customer's account by an originator on request.
A direct debit may or may not be subject to advance notice and the amounts may vary. Examples include the payment of utilities, news subscriptions, or the periodic collection of insurance premiums or loan payments.
Wire Transfer: Wire transfer is a method of transferring money from one entity to another
So U can create the APP Config FBZP for the ACH and Wire payments
Additionally search sdn.sap.com, you will find lot of information.
Please let me know if you need more information.
Assign points if useful.
Regards
Sridhar M -
What is the diff b/w Conventional Path and Direct Path?
What is the diff b/w Conventional Path and Direct Path?
While doing exp/imp
which one is best in peroformance Conventional Or Direct
consider my Oracle is 9i (9.2.0) and Os is Solaris 9
Could you please clarify.....
Thankshttp://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch01.htm#1005685
-
Issues in persisting dynamic entity and view objects using MDS
Hi All,
I'm trying to create dynamic entity and view objects per user session and to persist these objects throughout the session, I'm trying to use MDS configurations(either file or Database) in adf-config.xml.
I'm facing following two errors while trying to run the app module:
1. MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/model/DynamicEntityGenModuleOperations.xml"
2. oracle.mds.exception.ReadOnlyStoreException: MDS-01273: The operation on the resource /sessiondef/dynamic/DynamicDeptEntityDef.xml failed because source metadata store mapped to the namespace / DEFAULT is read only.
I've gone through the following links which talks about the cause of the issue, but still can't figure out the issue in the code or the config file. Please help if, someone has faced a similar issue.
[http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG |http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG ]
[http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm|http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm]
Attached is the code for dynamic entity/view object generation and corresponding adf-config.xml used.
///////////App Module Implementation Class/////////////////////////
public class DynamicEntityGenModuleImpl extends ApplicationModuleImpl implements DynamicEntityGenModule {
private static final String DYNAMIC_DETP_VO_INSTANCE = "DynamicDeptVO";
* This is the default constructor (do not remove).
public DynamicEntityGenModuleImpl() {
public ViewObjectImpl getDepartmentsView1() {
return (ViewObjectImpl) findViewObject("DynamicDeptVO");
public void buildDynamicDeptComp() {
ViewObject internalDynamicVO = findViewObject(DYNAMIC_DETP_VO_INSTANCE);
if (internalDynamicVO != null) {
System.out.println("OK VO exists, return Defn- " + internalDynamicVO.getDefFullName());
return;
EntityDefImpl deptEntDef = buildDeptEntitySessionDef();
ViewDefImpl viewDef = buildDeptViewSessionDef(deptEntDef);
addViewToPdefApplicationModule(viewDef);
private EntityDefImpl buildDeptEntitySessionDef() {
try {
EntityDefImpl entDef = new EntityDefImpl(oracle.jbo.server.EntityDefImpl.DEF_SCOPE_SESSION, "DynamicDeptEntityDef");
entDef.setFullName(entDef.getBasePackage() + ".dynamic." + entDef.getName());
entDef.setName(entDef.getName());
System.out.println("Application Module Path name: " + getDefFullName());
System.out.println("EntDef :" + entDef.getFileName() + " : " + entDef.getBasePackage() + ".dynamic." + entDef.getName());
entDef.setAliasName(entDef.getName());
entDef.setSource("DEPT");
entDef.setSourceType("table");
entDef.addAttribute("ID", "ID", Integer.class, true, false, true);
entDef.addAttribute("Name", "NAME", String.class, false, false, true);
entDef.addAttribute("Location", "LOCATION", Integer.class, false, false, true);
entDef.resolveDefObject();
entDef.registerSessionDefObject();
entDef.writeXMLContents();
entDef.saveXMLContents();
return entDef;
} catch (Exception ex) {
System.out.println(ex.getLocalizedMessage());
return null;
private ViewDefImpl buildDeptViewSessionDef(EntityDefImpl entityDef) {
try {
ViewDefImpl viewDef = new oracle.jbo.server.ViewDefImpl(oracle.jbo.server.ViewDefImpl.DEF_SCOPE_SESSION, "DynamicDeptViewDef");
viewDef.setFullName(viewDef.getBasePackage() + ".dynamic." + viewDef.getName());
System.out.println("ViewDef :" + viewDef.getFileName());
viewDef.setUseGlueCode(false);
viewDef.setIterMode(RowIterator.ITER_MODE_LAST_PAGE_FULL);
viewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
viewDef.setSelectClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
viewDef.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
viewDef.addEntityUsage("DynamicDeptUsage", entityDef.getFullName(), false, false);
viewDef.addAllEntityAttributes("DynamicDeptUsage");
viewDef.resolveDefObject();
viewDef.registerSessionDefObject();
viewDef.writeXMLContents();
viewDef.saveXMLContents();
return viewDef;
} catch (Exception ex) {
System.out.println(ex.getLocalizedMessage());
return null;
private void addViewToPdefApplicationModule(ViewDefImpl viewDef) {
oracle.jbo.server.PDefApplicationModule pDefAM = oracle.jbo.server.PDefApplicationModule.findDefObject(getDefFullName());
if (pDefAM == null) {
pDefAM = new oracle.jbo.server.PDefApplicationModule();
pDefAM.setFullName(getDefFullName());
pDefAM.setEditable(true);
pDefAM.createViewObject(DYNAMIC_DETP_VO_INSTANCE, viewDef.getFullName());
pDefAM.applyPersonalization(this);
pDefAM.writeXMLContents();
pDefAM.saveXMLContents();
////////adf-config.xml//////////////////////
<?xml version="1.0" encoding="windows-1252" ?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
xmlns:sec="http://xmlns.oracle.com/adf/security/config">
<adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
<defaults useBindVarsForViewCriteriaLiterals="true"/>
<startup>
<amconfig-overrides>
<config:Database jbo.locking.mode="optimistic"/>
</amconfig-overrides>
</startup>
</adf-adfm-config>
<adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
<adf-property name="adfAppUID" value="TestDynamicEC-8827"/>
</adf:adf-properties-child>
<sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
<CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore" credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
</sec:adf-security-child>
<persistence-config>
<metadata-namespaces>
<namespace metadata-store-usage="mdsRepos" path="/sessiondef/"/>
<namespace path="/model/" metadata-store-usage="mdsRepos"/>
</metadata-namespaces>
<metadata-store-usages>
<metadata-store-usage default-cust-store="true" deploy-target="true" id="mdsRepos">
<metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
<property name="metadata-path" value="/tmp"/>
<!-- <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
<property name="jndi-datasource" value="jdbc/TestDynamicEC"/>
<property name="repository-name" value="TestDynamicEC"/>
<property name="jdbc-userid" value="adfmay28"/>
<property name="jdbc-password" value="adfmay28"/>
<property name="jdbc-url" value="jdbc:oracle:thin:@localhost:1521:XE"/>-->
</metadata-store>
</metadata-store-usage>
</metadata-store-usages>
</persistence-config>
</adf-config>
//////////////////////////////////////////////////////////////////////////////////////////////////////////Hi Frank,
I m trying to save entity and view object xml by calling writeXMLContents() and saveXMLContents() so that these objects can be retrieved using the xmls later on.
These methods internally use MDS configuration in adf-config.xml, which is creating the issue.
Please share your thoughts on resolving this or if, there is any other way of creating dynamic entity/view objects for db tables created at runtime.
Nik -
Remote and direct update of master data at the same time
Hello
Is it possible to do remote and direct update of master data at the same time? If yes where it could be used?
ThanksHi,
What do you mean by Remote Update ?
regards
Happy Tony -
I have been trying to download apps from the app store and every time it tells me there is a problem with my previous billing and direct me to put in new billing information and every time i do that it still will not let me download any apps.
Have a look here > http://support.apple.com/kb/TS1646
-
What is a Legal Entity and Operating Unit??
Hi,
Could someone let me know what exactly is a Legal Entity and Operating Unit. The definition or explanation in the documentation is not satisfactory or clear. What are the differences between the above.
And where in the per_all_assignments_f table is the Legal entity stored. I know that the Legal entity is stored in the Statutory information in the assignments screen. Also can someone let me how based on the company code in the organization the legal entity is linked. Where in the tables is this link maintained?
Could someone let me know the above.
Thanks
Shekar.Dear Shekar
what exactly is a Legal Entity and Operating Unit?
ANS: According the Book or user guide definitions says:
GRE/Legal Entity: Use this classification to represent the following organizations:
Ultimate Legal Entity: this represents the enterprise, and typically, the enterprise is the highest (global) level of a business organization.
Legal Entity: this represents the designated legal employer for all employment-related activities. The legal authorities in a country recognize this organization as a separate employer. In an organization hierarchy, a legal entity may report to an operating company or to the ultimate legal entity.
Consolidated Legal Entity: this organization acts on behalf of multiple operating companies that are not legally registered, or simply on behalf of the enterprise in a country.
See Shekar the Legal Entity is taken under Classification is we know that the organization is going to show the Taxation to the Government. where as if u take typical UAE countruies here every store is an LLC and they submit the taxing for every store or shop.
Where as Operating Unit is generally used for the different lines of business which are under that Business GRoup
Say for an Example:
ABC is the Company name and that has its root in UAE, Qatar and Oman
then it is like ABC Business Group > UAE Legal Entity > REtail/Property/Furniture etc are the Operating Units.
Hope this information is helpful and clear to you or else let me know if you have any concerns.
Coming to the Company Code we use the code for the Inventory Organizations so that the clients will not get confused with the existing code and the system code so generally we use the same codes for it. -
Can I upload a simple iPhone App that all it does is direct the User to a Filemaker Pro URL fmp://~filename.fmp?$VariableName=Value This launches Filemaker Go and directs the user to the Database Hosted online
Right now there is no app store for Filemaker Go. Filemaker Forgot about us.
So I want to create a simple native iPhone App that all it does
is launch
fmp://~/filename.fmp12?$VariableName=value
This URL will launch the Filemaker Go App
Filemaker Go is a app that the user will have to have
downloaded already on the device..
The Simple Native app will launch the Filemaker Go.
The fmp URL has the information where the Filemaker Pro database is hosted
and get the user where they need to be..
Help Me please
iPhone 5s, iOS 8.1.3That would be software. And, you said "upload." That's "uploading software." Why do you question what you stated?
I don't know where you even want to upload this software. The only way it can be downloaded to a device is through the iTunes store. Do you even know what you want to do?
Maybe you are looking for
-
Hi , I am working in Solaris 9 x86, with Oracle installed on it.I am getting memory leaks reported in occi library. Machine Details: Hostname: ALEXANDER Hostid: 2ed11ae9 Release: 5.9 Kernel architecture: i86pc Application architecture: i386 Hardware
-
Itunes wont start and when I try and reinstall a virus is detected
I am running windows vista and Installed the Itunes update over the weekend. Now I can't start I tunes and when I try and download the program I am told that it contains a virus and my system won't allow the install. Help
-
Editing html files using Contribute
I have just purchased the tracking software ProspectFinder from Enecto.com that lets me see the names and details of the companies visiting our website. In order for the tracking to function, I need to paste some lines of html code to the respective
-
Unable to revert back to simple passcode
i tried to turn off the simple passcode just to see how the non-simple passcode works. i dont like it much so i want to revert back to the simple passcode but the on/off button is disabled as well as the button to turn off the passcode.. please help
-
HT5312 Rescue email address and how to reset apple I'd security questions
Rescue email address and how to reset apple I'd security questions