Help on JPA and HSQL
Hi All,
I am facing a strange issue with OpenJpa and HSQL while running the Junit Test case.
For more details on the same please see.
Facing issue with OpenJPA and HSQL...?
Suggestions on the same would be very helpful.
thanks
The Exception thrown is self explanatory. Pay attention on reading the exception:
openjpa-1.1.0-r422266:657916 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Column already exists in statement [ALTER TABLE HS_STUDY_FP ADD COLUMN CMODEV2_FE VARCHAR(255)] {stmnt 25709120 ALTER TABLE HS_STUDY_FP ADD COLUMN CMODEV2_FE VARCHAR(255)} [code=-27, state=S0021]
As you said it runs successfully first time and gives error on running next time.
When run first time, the column is already added, and tried next time obviously it gives error.
EDITING:
So make sure, the added column is dropped before running the test case again.
Similar Messages
-
Need help understanding JPA and detached entities.
I keep getting the dreaded "Cannot Persist detached object" and I cannot understand why EclipseLink is even trying to persist the object.
The following is a general scenerio if the issue:
1. I have 3 objects "Parent", "Child", and "Agency".
2. I create a new "Agency" and persist it using em.persist(agency).
3. The "Parent" object contains a OneToMany relation to "Child" and "Child" has a reference to "Agency".
4. So I do something like:
agency = new Agency();
em.persist(agency);
child = new Child();
child.setAgency(agency);
parent = new Parent();
parent.addChild(child);
em.persist(parent);
I have Cascade.ALL on the OneToMany relation so I expect that persisting the parent will also persist the child. This part works, however for some reason the agency is trying to be saved and that's were I get the error.
Now if agency was not already persisted, everything works fine. Parent, Child, and Agency all get persisted.
Since there isn't really a way to merge() agency how do I handle this issue?
I don't really understand all the clones and how merge works, so I don't have a good grasp on how cascade works itself through the objects? I did step through the code in the debugger and it simply wants to register agency as a new object even though the primary key is set.Hello,
I believe what you are showing and trying is just confirming what I mentioned in my previous post. The specification does not allow you to persist a detached entity and forces an exception to be thrown. When you have a detached entity referenced through a relation marked with cascade persist and then call persist on the owning object, it is the same thing as calling persist on the detached object directly - you will get an exception. If the relation is not marked cascade persist, and agency is new then you definetely will get an exception - without the provider finding out and throwing its own exception, the child object would have tried to insert a foreign key to an agency that doesn't exist.
Not marking the relation as cascade persist or using find will only work if the agency exists and was previously persisted. The problem then you mention is that you might have made changes to the detached agency or it may not already exist - the JPA provider only finds changes made to managed objects. Merge can be used when you do not know if it exists, and it will pickup changes made to the detached object.
Solutions are:
1) agency = em.merge(agency);
child.setAgency(agency);
or 2) em.merge(parent);
Solution 1 might be more efficient, since merge on new objects could require more resources than persist due to existence checking requirements.
Best Regards,
Chris
... -
Stored procedure, EJB, JPA, and JavaServer Faces
Hi!
I am currently working on a Web application using EJB, JPA, and JavaServer Faces. A part of the
business logic is already stored in the database as stored procedures, so we need to call those
procedures (instead of named queries) through a EJB and represent the data on the web tier.
Where can I find an extensive tutorial using this technology? There is no such tutorial in the Oracle Learning Library.
Maybe somebody can provide a link and/or example.
Thanks in advance for your help!Hi,
http://download.oracle.com/docs/cd/B10464_05/web.904/b10313/queries.htm#1135305
For more help, see the TopLink / JPA forum
TopLink/JPA
Frank -
JPA and CAF BO - are there any editors of the JPA data (like CAF)?
Hello!
As you know SAP invented some layer above JPA and called it CAF. There is a very convenient way to edit data in CAF.
But now I have to create a complex database scheme, also with CAF doesn't allow us to work with objects. So we can't use someObject.getChildren().
So my question is are there any editors of the JPA data (like it is done in CAF)?Hi Kirill,
at the beginning of our project at the end of 2009, we did a deep analysis of CAF since our architect vehemently suggested to use this framework.
First about the history and purpose of CAF: Initially, CAF was never meant to be a layer above CAF since CAF was invented in the time before EJB 3.0 and JPA standard where writing persistence with EJB 2.x CMP forced the developer to write pages of boiler plate code. This background was approved by SAP.
With upcoming of JPA, CAF ist mostly useless (except for very simply structured data) and prevents you from writing good software.
It is easy just to write @Entity, @Id and @OneToMany (for complex database schemes) and CAF forces you to use an ugly, imperformant database scheme (e.g. CAF uses mapping tables even for 1:n relationships, a clear antipattern!)
The CRUD-services generated with CAF are a pain, too. Usage of pessimistic locking is not up to date for web applications.
With your complex database schemes, you exceed the limit of CAF.
(We decided not to use CAF and did never regret this.)
Concerning your question: There is an "JPA Details" view in NWDS that might help you. It needs JPA Persistence facet on your project to work. Developed by SAP. For JPA beginners, it is a good cheat sheet for JPA annotations and their attributes.
You do not need more since a JPA POJO is easy to code.
Regards,
Rolf -
Hi people...
I working with JPA and Hibernate and i have a View in my Database and i need to map this View. It's this possible? Some have an example to show me?.
Thanks!I hope this link help you
http://forums.java.net/jive/message.jspa?messageID=244187
I�m having a similar problem, I�m developing using JPA and now I need to bring values from some views on database but I still don�t know how.I�m still Java jr and I didn�t understand clearly but I guess that the link can help you, and if it�s true please explain me. -
I need help to find and open a job app that I exported, was able to fill out and sign and saved and now can't open it? What did I do wrong?
What file format did you export it to?
-
please help - installed IOS7 and now I am having problems playing Words Free on my Iphone. It gives me a pop up telling me to connect to ITunes but will not connect. Cannot get out and have to continually shut down my phone and start over.
Hi, jeantwin.
Thank you for visiting Apple Support Communities.
The steps in the article below may help you resolve the issue with push notifications.
iPad and iPod touch: Unable to use YouTube or Push notifications
http://support.apple.com/kb/ts3305
If the issue persists, try signing out of your Apple ID and then sign back in.
iOS: Changing the signed-in iTunes Store Apple ID account
http://support.apple.com/kb/HT1311
Cheers,
Jason H. -
Does any update help to install and run myFaces components?
Hi.
I have JSC trial. And didn't make update.
I can't install myFaces component library. Why?
Does any update help to install and run myFaces components, and other component library?
Thanks.Hi,
The following thread could be of help for you:
http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=48666
Cheers :-)
Creator Team -
Need help to import and syncronize HCM pagelets with Interaction Hub, how can I do that?
Hi,
I need help to import and synchronize HCM pagelets with Interaction Hub, how can I do that? The default page "Select Remote Content" of the WorkCenter "Unified Navigation WorkCenter" is not working as well, when I run the import/sync button I get the following error message:
Integration Gateway: General Connection Failed (158,10836)
This error is thrown when there is no valid response.
Possible errors include:
Bad gateway URL
Sync Service Timeout set and Service actually timed out.
Java exception thrown - Check Application Server for possible Java exceptionDo you have integration configured between the two systems? It sounds like you don't from the error. Here is a walk-through on setting up Unified Navigation although it assumes you have integration already working. If you haven't done that, it's documented a hundred different places.
http://remotepsadmins.com/2013/03/04/peoplesoft-unified-navigation-with-peoplesoft-applicatations-portal-interaction-hub/ -
my account is locked, i cant remember my security question, and I accidentally entered my itunes card in here instead of my other account, so can someone from apple help me out and fix my account (and no, i dont have any rescue email address or whatsoever)
please help me because i dont to waste money for nothingAlternatives for Help Resetting Security Questions and/or Rescue Mail
1. If you have a valid rescue email address, then use this procedure:
Rescue email address and how to reset Apple ID security questions.
2. Fill out and submit this form. Select the topic, Account Security. You must
have a Rescue Email to use this option.
3. This is the only option if you do not already have a valid Rescue Email.
These are telephone numbers for contacting Apple Support in your country.
Apple ID- Contacting Apple for help with Apple ID account security. Select
the appropriate country and call. Ask to speak to the Account Security Team.
4. Account security issues almost always require you to speak directly to an
Apple representative to securely establish your identity as the account holder.
You can set it up so that Apple calls you, either immediately or at a time
convenient to you.
1. Go to www.apple.com/support.
2. Choose Contact Support and click Contact Us.
3. Choose Other Apple ID Topics and choose the appropriate topic for
your issue.
4. Follow the onscreen instructions.
Note: If you have already forgotten your security questions, then you cannot
set up a rescue email address in order to reset them. You must set up
the rescue email address beforehand.
Your Apple ID: Manage My Apple ID.
Apple ID- All about Apple ID security questions. -
Help with writing and retrieving data from a table field with type "LCHR"
Hi Experts,
I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
Thanks in advance,
C
SAVING THE LIST DATA TO DB
DATA: L_WA(800).
LOOP AT T_TAB into L_WA.
ZDBTAB-DATALEN = STRLEN( L_WA ).
MOVE: L_WA to ZDBTAB-RAWDATA.
ZDBTAB-LINENUM = SY-TABIX.
INSERT ZDBTAB.
READING THE DATA FROM DB
DATA: BEGIN OF T_DATA,
SEQNR type ZDBTAB-LINENUM,
DATA type ZDBTAB-RAWDATA,
END OF T_TAB.
Select the data.
SELECT linenum rawdata from ZDBTAB into table T_DATA
WHERE repid = w_repname
AND rundate = w_rundate
ORDER BY linenum.
Populate calling Internal Table.
LOOP AT T-DATA.
APPEND T_DATA to T_TAB.
ENDLOOP.Hi Anuj,
The unicode flag is active.
When I run our report and then to try and save the list data a dump is happening at the following point
LOOP AT T_TAB into L_WA.
As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
When I try to load a saved list the dump is happening at the following point
APPEND T_DATA-RAWDATA to T_TAB.
T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
Regards
C -
My late 2011 Macbook Pro is not working properly it is very slow and extremely painful to use, I went to a Genius Bar appointment, they were not helpful at all and just told me to go off and reboot my Mac and then restore via TimeMachine. I dont know how to do this. I am extremely displeased with Apple at the moment, can someone please help me?
Your problem description is generalized and non-specific. I would make another appointment at the Apple store and insist they help you execute their suggested fixes.
Incidentally, if you search this site, Apple has excellent articles re: restoring a system.
Barry -
hey guys,i tried to install the latest version of itunes but when i try to open it,it just comes up windows error 2 apple application support was not found,can anyone help me out and tell me what i need to do pls ?
If you run into the "another installation" message even after the reboot of the PC (which is an excellent idea by HTP ProXy), reregistering your Windows Installer Service is worth a try.
First, launch a command prompt as an administrator. In your Start search, type cmd then right-click on the cmd that comes up and select "Run as administrator".
At the command prompt:
Type %windir%\system32\msiexec.exe /unregister and hit enter.
Type %windir%\syswow64\msiexec.exe /unregister and hit enter.
Type %windir%\system32\msiexec.exe /regserver and hit enter.
Type %windir%\syswow64\msiexec.exe /regserver and hit enter.
Restart the PC and try another reinstalll. -
Using Search Help with ALV and Dynamic context node
The topic subject already describes my situation.
I have to create, populate and remove context nodes at runtime, and bind them to an ALV, to let user display the data or modify the data. The nodes I create are always typed with a table name, but the table name is of course, dynamic.
This is all working: what's not working is help for entries inside the ALV; since the table has foreign keys and domains with check tables or fixed values, I expected that search helps were detected and managed by the framework.
Instead, no help search is displayed except the input help based on data-type of the one "Date" input fields.
I think I have to work on the dynamic node creation, and not on the ALV itself, since the latter only takes the node/attributes information, but i could be wrong. I tried with both the two following codings:
CALL METHOD lo_nd_info_root->add_new_child_node
EXPORTING
static_element_type = vs_tabname
name = 'SAMPLE_NODE_NAME'
* is_mandatory = abap_false
* is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_false
* is_singleton = abap_false
is_initialize_lead_selection = abap_false
is_static = abap_false
RECEIVING
child_node_info = lo_nd_info_data .
cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
parent_info = lo_nd_info_root
node_name = 'SAMPLE_NODE_NAME'
structure_name = vs_tabname
is_multiple = abap_true ).
The result is the same...is there any way to let the ALV know what search helps it has to use, and doesn't force me to manually build a VALUE_SET to be bound on the single attributes? There are many tables, with many fields, and maintaining this solution would be very costly.I have checked with method GET_ATTRIBUTE_VALUEHELP_TYPE of interface IF_WD_CONTEXT_NODE_INFO, on an attribute which i know to have a search help (Foreign key of a check table).
The method returns 'N', that is the constant IF_WD_VALUE_HELP_HANDLER~CO_VH_TYPE_NO_HELP. So, the framework was not able to find a suitable search help.
Using method GET_ATTRIBUTE_VALUE_HELP of the same interface, on the same attribute, returns me '111', which is constant C_VALUE_HELP_MODE-AUTOMATIC.
Therefore, the WD framework knows it has to automatically detect a value help, but fails to find one.
Also, this means in my opinion that the ALV and the dynamic external mapping are not the culprits: since node creation, no help is detected for any attribute but the date. Honestly, I don't have a clue on what's happening. -
Tax with the help of idoc and EDI
Dear gurus,
how can we process tax data that is used between two systems through the help of IDOC and EdI? It would be great for ur kind support.Hi Amit,
I do not understand how a non-sap system having an idoc adapte?
Do you mean the non-sap system has the ability to understand the IDOC files?
If yes, then your scenario is typically a IDOC-to File scenario.
Read this:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e07dcaa0-a92b-2a10-3a96-b3d942bd1539
If you do not intend to use XI in between, then you can just configure the outbound IDOCs in your SAP system and configure a file port in we21 transaction and create the partner profile in we20 transaction.
Regards,
Ravi
Maybe you are looking for
-
Mighty Mouse slow when computer busy
In January I bought a MacBook Pro to replace a Macbook and am using the same mighty mouse that I used with the macbook. I sometimes copy large files from my server to my macbook or the other way around. While the copy function is going on my mighty m
-
I have iphone 4s and i want to unlock it can you help me ?
I have iphone 4s and i want to unlock it can you help me ?
-
Can we write code using BD79(ALE IDoc Conversion Rule)
Hi - I had created a conversion rule that specifies for the field account group (KTOKD) on KNA1: I need to include the following logic : if the customer number (KNA1-KUNNR) is in the range 0010000000-0019999999 or 0140000000 to 0149999999, then cha
-
Cant find mozilla program files
i have run through the mozilla page on how to allow mozilla through windows firewall when i get the end i cant find mozilla firefox in the program files to add it to the exemption list
-
I am trying to load my illustrator cs6 onto home computer, second use-have installed it on my work computer, but it won't accept my serial number at home, do I need to re-register product?