Persistence saving more than once to Table
Hello all,
A funny scene creeped into my code and I wish to know if anyone has had such before.
An entity class (A) is related to three other classes (B, C, D) with the @OneToOne. But after every persist() method call, I discover three entries for B, C and D for every one entry in A.
what could be wrong with my configuration?
Michael
i found a thorough thread on this:
http://myrightbrain.wordpress.com/2006/08/12/how-to-do-multisession-burns-with-m ac-os-x/
*be certain to read through the comments below the instructions as well*
Message was edited by: BIGSLUG
Similar Messages
-
ORA-00604 & ORA-30512 CANNOT MODIFY TABLE MORE THAN ONCE IN A TRANSACTION
We have a requirement where two tables should be in sync at any given point
in time with respect to the structure of the tables.
Any change on table/column via ALTER (MODIFY, ADD, RENAME COLUMN, DROP
COLUMN) on the parent table should be replicated to the replica table.
I created a DDL_TRIGGER on the schema and the desired result is achieved but
for the following one scenario for which its failing.
The issue is, if we try to reduce the width of the column (via ALTER ..
MODIFY) it fails with the following error
ORA-00604: error occurred at recursive SQL level 1
ORA-30512: cannot modify DEVTESTF_OIM.REPLICA_ABC more than once in a
transaction
Please follow the steps to reproduce the issue (the issue is across the DB
version checked on 10.2, 11.1 and 11.2 DB version)
-- Step1 Create Parent Table
CREATE TABLE abc (col1 VARCHAR2(10))
-- Step2 Create Replica Table
CREATE TABLE replica_abc (col1 VARCHAR2(10))
-- Step3 Create DDL Trigger
CREATE OR REPLACE TRIGGER ddl_trigger
AFTER ALTER ON SCHEMA
DECLARE
operation VARCHAR2(30);
object_name VARCHAR2(30);
l_sqltext VARCHAR2(100);
i PLS_INTEGER;
l_count NUMBER:=0;
sql_text dbms_standard.ora_name_list_t;
BEGIN
i := dbms_standard.sql_txt(sql_text);
SELECT ora_sysevent, ora_dict_obj_name, UPPER(sql_text(i))
INTO operation, object_name, l_sqltext
FROM dual;
IF ora_dict_obj_name = 'ABC' THEN
l_count := INSTR(l_sqltext,'ADD CONSTRAINT',1,1);
l_count := l_count + INSTR(l_sqltext,'DISABLE',1,1);
l_count := l_count + INSTR(l_sqltext,'DROP CONSTRAINT',1,1);
l_count := l_count + INSTR(l_sqltext,'PRIMARY KEY',1,1);
l_count := l_count + INSTR(l_sqltext,'ADD CHECK',1,1);
IF (l_count = 0) THEN
l_count := INSTR(l_sqltext,'ADD',1,1);
l_count := l_count + INSTR(l_sqltext,'MODIFY',1,1);
l_count := l_count + INSTR(l_sqltext,'DROP COLUMN',1,1);
l_count := l_count + INSTR(l_sqltext,'RENAME
COLUMN',1,1);
IF (l_count >0) THEN
l_sqltext := REPLACE(l_sqltext,'TABLE ABC','TABLE REPLICA_ABC');
execute immediate l_sqltext;
END IF;
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
RAISE ;
END;
-- Step 4 Issue the following ALTER command on the Parent table 'ABC'
ALTER TABLE ABC MODIFY COL1 VARCHAR2(9);
will show the following
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-30512: cannot modify DEVTESTF_OIM.REPLICA_ABC more than once in a
transaction
ORA-06512: at line 34
whereas the following commands works fine
ALTER TABLE ABC MODIFY COL1 VARCHAR2(11);
and also the rest of the operations
ALTER TABLE ABC ADD COL2 VARCHAR2(20);
ALTER TABLE ABC RENAME COLUMN COL2 TO COL3;
ALTER TABLE ABC DROP COLUMN COL3;
The issue is while reducing the size of VARCHAR2 columns, while the rest of
option works fine.
Any suggestion or workaround please.It looks like a bug to me. The failing statement from the SQL trace is
PARSE ERROR #12:len=77 dep=3 uid=0 oct=3 lid=0 tim=1263332549608656 err=30512
select /*+ first_rows */ 1 from "TIM"."REPLICA_ABC" where LENGTHB("COL1") > 9and exception cannot explain it. -
How to use a picture more than once in the light table?
when i drag a picture from my browser to the light table i get the number 1 in the thumbnail. the book suggests that we can drag more than once the same picture in the light table but i have not yet figured out how to do it? any ideas?
Indeed it do, I have that book, and you and I have both proven, beyond any doubt, the authors are incorrect.
I tried all weekend to build a light table display that would print on half of a piece of paper. I figured I'd just select all, duplicate or copy and paste and set up another display just like it. That way, I'd print one sheet, trim it in half and have two nice assemblies of the same images. Took me many hours of dicking around to arrive at my lame non-solution.
Hope someone else gives us both better advice.
bogiesan -
I have my catalog "Back Up Each Time Lightroom Exits" checked, and always have. That means the catalog should have been backed-up and saved everyday, if not more than once on some dates. So with a a major problem now and needing to use the Catalog backup from last Friday, I go to my Lightroom Backups folder - and the most recent one showing not only isn't yesterday, it's OCTOBER 28 !?? Where the hell are the daily backups between October 28 and November 14?
Oh wow - JET LAG strikes agin - my apologies; I have located the missing weeks of back-ups. After getting home from a 30-day trip to Europe, I had changed the location of my LR catalog back-ups to an external drive, and forgot that I did that. I have found them, and all is good. Never operate Heavy Machinery without enough rest. Cheers
-
Hello All,
We have crystal reports integrated in the java web application. Reports with parameters are executing query more than once (found in the SQL Server Profiler).
Scenario:
Report query with parameter :- select * from cieuser where id >= {?userId}.
User provides value '1' to this parameter and selects report execution.
Before executing the report, our system updates the database connection details of the rpt with other configured details.
Issues:
During updating of the database details on execution of statement "databaseController.setTableLocation(orig.getTable(i), table);" , the profiler shows:
select * from cieuser where id >= NULL
And on executon of the statement "viewer.processHttpRequest(request, response, getServletConfig()
.getServletContext(), null);" the profiler shows the following:
select * from cieuser where id >= {?userId}
select * from cieuser where id >= 1
select * from cieuser where id >= 1
When the same report is executed from the standalone crystal designer, the profiler shows one time query execution:
select * from cieuser where id >= 1
Environment:
Crystal reports designer - 11.5.10.1263
JRC - 11.5
Please advise.
Thanks,
Ratan.Hello,
SAP decided to allow the confirmation of orders with a final confirmation (status CNF) deliberately. So it is possible to confirm work that was maybe forgotten or if the flag 'final confirmation' was set mistakenly. Only the status CLSD will prevent further confirmations.
If you want forbid further confirmations of orders with status CNF you can use enhancements CONFPM* or BAdI WORKORDER_CONFIRM. However, the probably easiest way is to define a user status that is set at business transaction 'Confirm order' and, once set, forbid business transaction 'Confirm order'.
Regards,
Reinhard -
Prepared statement st in servlet - not executing more than once!
Hi,
my problem is that the following piece of code in a servlet does not get executed more than once:
myQuery = "DELETE FROM MREMINDERS WHERE username=? AND reminders=?";
PreparedStatement st = conn.prepareStatement(myQuery);
st.setString(1,usern);
st.setString(2,oldRem);
st.executeUpdate();
st.close();
The above code is called in a servlet to delete fields from a table. I call this code in a for loop from another method in the servlet. It executes the first time in the loop, but the second time onwards it throws an error!!! please let me know how to solve this ASAP since i am at the point of frustration now!!!
thanx...Hi,
sorry... i got it fixed!!!! :-)
i was closing a JDBC connection which was generating that error!!
thanx again.. -
Hello Experts
I'am facing a peculiar problem pertaining to Infoset query ( Tran SQ01,SQ02, SQ03) . The requirement is to create a query based on table GLPCA and CATSDB.
I've created the query as required, However when i execute the same the output is incorrect. What really happens is the Same line is repeated more than once sometimes three, four or even five times.
The Table GLPCA has two line items per document one debit and one credit, now at the most in the query i should get only these two lines and if i further filter it on the indicator there shoul be only one entry. However this is not the case even when i filter i on the posting indicator the query outputs the line item 5 times giving a wrong report.
Can somebody suggest as what could be wrong with the query
Thanks
NelsonHi,
Nothing is wrong with the query.
Kindly check ur join condition in SQ02
I have created its coming correct.
Regards
Arbind -
Count certain rows more than once
I have the sql below:
select count(*), ind_encounter
from (
select x.sak_recip, x.dte_first_svc, x.ind_encounter
from t_tmp x
group by x.sak_recip, x.dte_first_svc, x.ind_encounter
union all
select x.sak_recip, x.dte_first_svc, x.ind_encounter
from t_tmp x
where x.sak_procedure in (1, 2, 3, 4) )
group by ind_encounter
What I need to do is count the sql in bold more than once. If one row in the table has sak_procedure = 1, I want to count that row 13 times. I know that if union 11 more sqls, I will count those 13 times.
I would like to know if someone knows an easer way.
thanks for your helptry
select count(*), ind_encounter,
sum(cnt1) -- your counter
from (select x.sak_recip, x.dte_first_svc, x.ind_encounter, count(*) * N cnt1
from t_tmp x
group by x.sak_recip, x.dte_first_svc, x.ind_encounter
union all
select x.sak_recip, x.dte_first_svc, x.ind_encounter, count(*) * M cnt1
from t_tmp x
where x.sak_procedure in (1, 2, 3, 4)
group by x.sak_recip, x.dte_first_svc, x.ind_encounter
group by ind_encounterEdited by: AlexAnd on Dec 4, 2011 11:21 PM -
Can any one help me i am having the problem with trigger . The trigger fires more than once. I want the trigger to be fired for every COMMIT and not for each row.
The pl/sql used for populating the table in given below
CREATE OR REPLACE TRIGGER REFRESH_MV_TRIGGER
AFTER INSERT OR UPDATE ON CONTACT_HISTORY
DECLARE
cnt NUMBER;
BEGIN
IF ( INSERTING ) THEN
dbms_output.put_line('INSERTING');
END IF;
IF ( UPDATING ) THEN
dbms_output.put_line('UPDATING');
END IF;
END;
DECLARE
BEGIN
FOR i IN 1..2 LOOP
INSERT INTO CONTACT_HISTORY(TARGET_ID,CAMPCODE,COMMSTAGE,CUSTOMER_KEY,solicit_dt)
VALUES(i,'CAMP4','COMM1',i,SYSDATE);
END LOOP;
COMMIT;
END;
sql> output when i run pl/sql block
INSERTING
INSERTINGI am not shure what you need exactly but maybe this might help:
CREATE TABLE dept (
deptno NUMBER(2) PRIMARY KEY,
dname VARCHAR2(14),
loc VARCHAR2(13)
CREATE TABLE dept_history (
deptno NUMBER(2),
dname VARCHAR2(14),
loc VARCHAR2(13)
CREATE MATERIALIZED VIEW dept_mv
BUILD IMMEDIATE
REFRESH ON COMMIT
AS SELECT * FROM dept
CREATE OR REPLACE TRIGGER bir_dept_mv
BEFORE INSERT ON dept_mv
FOR EACH ROW
BEGIN
INSERT INTO dept_history VALUES (:NEW.deptno, :NEW.dname, :NEW.loc);
END;
INSERT INTO DEPT (deptno, dname, loc) VALUES (1, 'D1', 'L1');
1 row created.
INSERT INTO DEPT (deptno, dname, loc) VALUES (2, 'D2', 'L2');
1 row created.
SELECT * FROM dept;
DEPTNO DNAME LOC
1 D1 L1
2 D2 L2
SELECT * FROM dept_history;
no rows selected
SELECT * FROM dept_mv;
no rows selected
COMMIT;
Commit complete.
SELECT * FROM dept_history;
DEPTNO DNAME LOC
1 D1 L1
2 D2 L2
SELECT * FROM dept_mv;
DEPTNO DNAME LOC
1 D1 L1
2 D2 L2Regards,
Zlatko Sirotic -
Displaying the records records which are coming more than once
hi
create table temp(comp_id int,branch_id int);
comp_id | branch_id
---------+-----------
1000 | 1
1000 | 1
1000 | 2
1000 | 2
1000 | 3
2000 | 1
2000 | 1
2000 | 2
2000 | 3
how can i write a query which displays the records records which are coming more than once on the basis of fields comp_id and branch_id. e.g. 1000 | 1 should be displayed because it is coming more than once. 1000 | 3 should not be, because it has a single entry.select comp_id, branch_id, count(*)
from temp
group by comp_id, branch_id
having count(*)>1
Please note this forum is not a SQL class and it is not the place to have your homework done.
Sybrand Bakker
Senior Oracle DBA -
Heading level hierarchy errors when topics are in TOC more than once
I have discovered that the hierarchy in the Heading levels in
the Printed Documentation will differ from than in my online help
table of contents hierarchy, and that the problem is due to topics
that are intentionally in the TOC more than once.
For example, in chapter 5 of a particular help system the
hierarchy should be:
Heading 1 < Chapter 5 title from top-level book>
Heading 2 <title of second level book>
Heading 3 <title of topic that appears under second-level
book>*
What I actually get is:
Heading 1 < Chapter title from top-level book>
Heading 2 <title of second level book>
Heading 4 <title of topic that appears under second-level
book>*
* This same topic appeared in an earlier chapter. In that
chapter it was really at a Heading 4 level.
Due to company styles, etc. we use a numbering system at the
headings and in the TOC, so instead of
5
5.1
5.1.1
I erroneously get
5
5.1
5.1.1.1
This type of hierarchy issue appears multiple times in this
particular document (which I inherited by the way.)
Other than restructuring the document to not reuse topics in
different places in the TOC, is there a solution or a workaround
for this problem?
What I am doing so far, is generating the Print Documentation
one chapter at a time. As long as a topic is not reused with the
same chapter, my hierarchy of heading levels is maintained;
otherwise, it is not. Then I can put the chapters back together
after fixing the few places that still have heading level problems.
This however, will be quite cumbersome as this document is
translated into nine other languages.
I am using RoboHelp X5 for Word / Word 2003 for the source
and most of the translations; RoboHelp Asian Edition, Simplified
Chinese / Word 2003 for the Chinese translation. The heading level
hierarchy error occurs in both versions.>> AF: I've commented in sections...
Without Maintain Heading Levels, RH will apply heading levels
to the books and then the topic levels will get bumped down. So a
top level book will be Heading 1 and the Headings in the topic will
get bumped down to 2, 3 and 4 etc. If then you have another book
one level down so that it gets Heading 2 applied, the same topic
but under the level two book would then get 3, 4 and 5 applied.
That is not the original problem but hopefully we are agreed
that is how things work on that.
>> Yes - that is the expected behavior. When it didn't
happen as expected, that's what led me to the discovery of the
cause of the problem (topic reuse).
Your problem was that firstly Heading 3 got bumped to Heading
4 if the same topic was inserted into the TOC twice. I assume it
was OK in the first instance, or is it that when you add it twice
it goes wrong everywhere?
>> Your assumption is correct. First occurrence is
correct. Second, third, and fourth (yes - there is one topic that
is used 4 times! ) are not correct based on TOC hierarchy.
On the numbering, nothing surprises me. If you look at my
site you will see that for RH HTML, i gave up on getting it right.
I have had many queries on this and more than a few people have
indicated they will work on the problem and get it working. I'm
still waiting. There are many posts about outline numbering
problems. Has anyone got it working satisfactorily?
>> I don't really have numbering problems. The
numbering is following the RoboHelp-generated hierarchy and the
.dot template that I apply. It's just that the RH-generated
hierarchy and its heading levels don't correspond to the "real"
hierarchy because of the reuse issue.
I have seen various Word gurus maintain that numbering has
not worked entirely satisfactorily since Word 2! Also enough posts
to convince me this is a Word issue, not a RH issue.
If you want to create a new project and knock something up
that demonstrates this problem, by all means zip it up and send it.
I'll assume it will be a small project and zip to less than 5mb. If
more, contact me first.
>> Unless you have RoboHelp X3 Asian Edition,
Simplified Chinese, there is really no need. I plan to either avoid
the reuse issue in the source, or build the print doc in sections
which is easy enough in RoboHelp X5 for the non-Chinese languages.
It is in the older Asian edition where the problems are compounded
by the omitted reuse topics. If you do have RoboHelp X3 Asian
Edition, Simplified Chinese and want to experiment, I can send you
a cut-down version of the project. Don't feel obligated though;
unless you can read Chinese (I can't) it is very tedious to work
with. -
Permissions Error if Script is run more than once with out closing Diadem
I am in a REAL pickle here and need some HELP......
I get a permissions error message when I try and run my scripts more than once with out closing Diadem 2011.
Call scriptinclude ("D:\_Calterm_Configuration_Files\Technical_Information\DIAdem_Scripts\Importing Multiple Data Logs_CaltermIII_Local.VBS")
Error is around this portion of script:
'******* GetFilePaths() *** *** NEW Function ***
Function GetFilePaths(DefaultDir, ExtFilter, MultipleDir, Msg)
Dim i, k, f, fso, iMax, FileListPath, StartIdx, CurrFiles, FileList
' Promt the User to select the ASCII files to load with a File Dialog
FileListPath = AutoActPath & "FileDlgList.asc"
Set fso = CreateObject("Scripting.FileSystemObject")
StartIdx = 0
ReDim FileList(0)
Do ' Until (DlgState = "IDCancel")
Call FileNameGet("ANY", "FileRead", DefaultDir, ExtFilter, FileListPath, 1, Msg)
IF (DlgState = "IDCancel") THEN Exit Do
' Read in the saved list of file(s) selected in the File Dialog into FileList()
**** This next line is where the ERROR happens *******
Set f = fso.OpenTextFile(FileListPath, 1, True) ' f.ReadAll returns file contents
CurrFiles = Split(vbCRLF & f.ReadAll, vbCRLF) ' turn file lines into an array
f.Close ' close the file
iMax = UBound(CurrFiles)
IF iMax > 0 AND Trim(CurrFiles(iMax)) = "" THEN
iMax = iMax - 1
ReDim Preserve CurrFiles(iMax)
END IF
Call BubbleSort(CurrFiles) ' sort the array of file names alphabetically
' Append current file dialog selection(s) to any previous file dialog selection(s)
IF iMax < 1 THEN iMax = 0
ReDim Preserve FileList(k + iMax)
FOR i = 1 TO iMax
k = k + 1
FileList(k) = CurrFiles(i)
NEXT ' i
IF MultipleDir <> TRUE THEN Exit Do ' forces only 1 dialog, good if all desired files are in the same folder
Loop ' Until (DlgState = "IDCancel")
GetFilePaths = FileList
End Function ' GetFilePaths()
266 6:18:34 PM Error:
Error in <NoName(1).VBS> (Line: 8, Column: 1):
Error in <Importing Multiple Data Logs_CaltermIII_Local.VBS> (Line: 140, Column: 5):
Permission denied
I can send the script and file I am loading if that would help.
Solved!
Go to Solution.Jcheese,
I understood that if you call this script within DIAdem you don't get any error, however, when you run that script from another source (with DIAdem opened) for the second time you get the error, right?
If this is the case, I think it might be that the file haven't close correctly in the script. Could you upload the script file?
Carmen C. -
Since I updated to iCloud, (which may or may not be related) Mail on my MacBookPro 10.6.8 has been unable to connect to MobileMe more than once or twice per day. Mail on my iPhone 4 and my old iMac has no problems. When there is no service a yellow warning triangle appears adjacent to the Inbox and Connection Doctor reports,"Trying to log into this MobileMe IMAP account failed. Verify that username and password are correct." Since it does fetch Mail from time to time they cannot be wrong.... can they? Should I update to 10.7 and if so what does that entail?
You have been using MobileMe's email settings, which sometimes continue to work for a time after migration but then get turned off. iCloud's mail server settings are different. Strictly speaking Lion 10.7.2 is required for iCloud, and on that Mail is set up automatically.
Snow Leopard cannot access most of iCloud's facilities, however you can set Mail up manually to access your email. The method is described here:
http://www.wilmut.webspace.virginmedia.com/notes/icloudmail.html
The situation with iCloud and Snow Leopard is described in detail here:
http://www.wilmut.webspace.virginmedia.com/notes/icloudSL.html -
How do I repeat the same row more than once in report 10g
How do I repeat the same row more than once in report 10g
So I can print the bar code more than once
in report;
Edited by: user11106555 on May 9, 2009 5:50 AMGREAT THAN X MAN
It is already working, but with the first ROW
select ename from emp
CONNECT BY ROWNUM<=5
ENAME
SMITH
SMITH
SMITH
SMITH
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS
JAMES
FORD
MILLER
BUT I want this result
Item1
Item2
Item3
to
Item1
Item1
Item1
Item2
Item2
Item2
Item3
Item3
Item3 -
Hi, I've been looking into this for awhile and believe the answer is 'no' but was just wondering if anyone here would know of a solution.
The company I work for has a formulier on which a number of Excel files are placed. This form is then sent to a five (often different) people who are then required to open the Excel files and if accord to place their digital signature. We would like to make sure that no one is able to sign the form more than once and also if possible to make sure they have opened the Excel files. It would be great if anyone had any tips...
All the very best,
Martin AngellI am not an Excel or Excel-to-PDF conversion expert, so I do not know how Excel forms are converted to PDF form fields. With this caveat here's what I do know.
In Acrobat It is possible to create a PDF form in which there are JavaScripts associated with fields (any fields, including signature fields). These JavaSripts can do a lot of things, including checking the signer's certificates on the already signed signature fields. Then you can make all unsigned signature fields read-only, in which case the user will not be able to actually sign them. After that you can overlay a button field on top of each unsigned signature field with exactly the same dimensions and associate a JavaAcript with this button field. This JavaScript would put up an UI asking the user for the signing certificate and its password, check this certificate's CN against the list of already signed signature fields and initiate the signing of the unsigned signature field behind this button if your condition is satisfied.
I never tried that myself but it could work. This looks complicated and it is but if you really want it you can try.
Maybe you are looking for
-
ITunes 6.0.1.3 and Genre changes
I have read through a bunch of threads but did not see a response to the following (hence the new post). I just went through my libary in iTunes and changes genres across all of my music to what i felt was proper. Now, every time I play a song in iTu
-
How Can I do an export that from Final Cut Pro 7 that is specific to these settings?
Hi I am current trying to export out a movie from Final Cut Pro 7 but the settings that are required are very specific and I was going to try it through compressor as well but I wasn't sure if that would work either. Here are the settings: HD: 1 Vide
-
Can't use Adobe Extension Manager to Install Photoshop plug-in
I am trying to install a plug-in from PSKiss to Photoshop CS5 (version 12.0.4). I'm using Adobe Extension Manager CS5.5, and I'm running Windows 7 on my laptop. Although I'm following up with PSKiss to see if there's a problem at this end, I also see
-
What is "DirectoryService"? and why is it taking up all my computing power?
My powerbook has been running this process called DirectoryService and it has been taking up 70-90% of my CPU (that's what my istat nano widget tells me anyway). I've restarted but when the computer comes back on the process is still running. I can o
-
Best free 3rd party plug-ins available?
What are the best free 3rd party plug-ins you guys use, and where do you get them? I have an intel mac, so I would appreciate if you guys could tell me about Universal Binary plug-ins. Thanks!