Help with Oracle Entity Framework and synonyms

Hi.
I have some troubles using schemas and synonyms of tables. It means that we are working with diferent schemas, one of those is the owner of tables and other one use synonyms with permissions to access, modify and delete in these tables, this one is the schema that the application use. So whats the way to use this synonyms to tables using the application schema with Entity Framework?
While I'm using the application data schema I couldn't get data from tables, because the application schema doesn't have tables just use synonyms to them.
Thanks in advanced
Cesar.

I have the same problem. I have created a data connection in the VS2010 server explorer to my oracle database. In the filter I have added the schemas that my user id has access to and the tables are shown in the server explorer. However, when I go through the ADO.NET entity wizard, the tables are not shown.

Similar Messages

  • Mvc with oracle entity framework

    Hi,
    I am new to both MVC and Oracle EF...i have installed the necessary components (ODAC beta 3) and tried out the tutorial that oracle has put up and was able to successfully finish it...
    Now i want to create a new MVC 3 app (based on MVC Movie tutorial available online) ...
    I have a model generated from my oracle database..however when i add a controller in MVC, the controller does not seem to recognize my model..What do i need to do so that controller can recognize the model that i generated from oracle database..????
    Is there an example out there that builds an asp.net MVC app using oracle entity framework??
    Thanks.

    Hello,
    is a week that I document but I still have a bit of confusion.
    Work on Oracle 11g with VS2010 I installed ODTwithODAC112030.
    I have to make a data entry form after the registration of an account.
    Can I create an application with MVC and EntityFramework then using Razor for pages CSHTML?.
    WHAT HAVE I DONE:
    1) Creating the Oracle schema QUESTIONARIO.
    2) Execution of InstallAllOracleASPNETProviders.sql
    3) Create application with MVC 3
    4) Insert the web.config connection parameters
    <connectionStrings>
        <add name="OraQuestConnString" connectionString="DATA SOURCE=...;....;USER ID=QUESTIONARIO;PASSWORD=*****" providerName="Oracle.DataAccess.Client" />
    5) Insertion of the parameters in the web.config for the management of user profiles
    <membership defaultProvider="OracleMembershipProvider">
    <profile>
            <providers>
              <clear />
              <add name="OracleProfileProvider" type="Oracle.Web.Profile.OracleProfileProvider, Oracle.Web, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraQuestConnString" applicationName="questionario_casa_ufficio" />
            </ Providers>
          </ Profile>
          <roleManager enabled="true" defaultProvider="OracleRoleProvider"> .......
    6) The application works and I registered users ORA_ASPNET_USERS etc..
    7) I have created the table "Questionnaire" in the DB
    8) I have created the Model of table "Questionnaire"
    9) I created the corresponding Controller and the Views pages with Razor who created in the "Views/Questionnaire" directory all management pages (Index.cshtml - Create.cshtml - Edit.cshtml - Delete.cshtml)
    10) when the application starts tells me I can not open the databasel SQL-Server, I suppose that it work only with SQL Server!! Or did I do something wrong?
    11) Then I create the Model from DATABASE using "ADO. NET Entity Data Model"
    12) But I did not understand if I can use the EDMX Model to create pages with Razor or with another tool.
    13) Is there an automated way to create pages of data management starting from the Model EMDX or do I have to create them all manually?
    Please help me.
    Thank you very much

  • Help with Oracle Report Builder and SQL Server2000

    Hey guys,
    I just installed it Oracle Developer Suite10g with Report Builder and I am trying to use Report builder and wants to connect with SQL Server 2000. The problem that I am running in to is SQL Server 2000 i have is Window Authentication so Does not required to enter user name and password. So how can i connect my report builder to SQL server or is it possible to connect Report builder to SQL server?
    Also, I want to create small practice version of database in Oracle how do i do it? what i mean by that is I installed trial version or Oracle developer 10g from www.oracle.com and now trying to get some knowledge with oracle. Could any one can give me some direction in this matter please.
    Thank You
    Key

    Have a look at the reports help for the purpose header and trailer sections. Here is an exert:
    "Report sectioning enables you to define multiple layouts in the same report, each with a different target audience, output format, page layout, page size, or orientation. You can define up to three report sections, each with a body area and a margin area: the names of the sections are Header, Main, and Trailer. By default, a report is defined in the Main section. In the other sections, you can define different layouts, rather than creating multiple separate reports. If you wish, you can use the margin and body of the Header and Trailer sections to create a Header and Trailer page for your reports."

  • Help with Oracle PL/SQL and Objects...

    Hi,
    I wonder if you can help me, I am having some trouble dealing with Oracle objects in PL/SQL. I can declare them, populate them and read from them without any issues.
    But I am having some problems with trying to copy records in to other records of the same type, and also with updating existing records. I've made a mock up piece of code below to explain what I mean, it may have a few mistakes as I've written it in notepad but should be reasonably clear.
    First I have created a record type, which contains attributes relating to a person.....
    CREATE OR REPLACE
    TYPE PERSON_RECORD_TYPE AS object (
                        Person_ID          NUMBER(3),
                        Person_Name     VARCHAR(20),
                        Person_Age          NUMBER(2),
                        static function new return PERSON_RECORD_TYPE );
    CREATE OR REPLACE
    TYPE BODY PERSON_RECORD_TYPE as
    static function new return PERSON_RECORD_TYPE is
    BEGIN
    return PERSON_RECORD_TYPE (
         NULL,
                             NULL,
                             NULL,
                             NULL,
                             NULL
    END;
    END;
    Then I have created a table type, which is a table of the person record type......
    CREATE OR REPLACE
    type PERSON_TABLE_TYPE as table of PERSON_RECORD_TYPE;
    Finally I have created a procedure which recieves an instance of the person table type and reads through it using a cursor.....
    PROCEDURE ADMIN_PERSON (incoming_person     IN     PERSON_TABLE_TYPE)
    IS
    -- This is a local record declared as the same type as the incoming object
    local_person PERSON_TABLE_TYPE;
    -- Cursor to select all from the incoming object
    CURSOR select_person
    IS
    SELECT      *
    FROM      TABLE ( cast (incoming_person AS PERSON_TABLE_TYPE));
    BEGIN
    -- Loop to process cursor results
    FOR select_person_rec IN select_person
         LOOP
              /* Up to this point works fine...*/
              -- If I want to store the current cursor record in a local record of the same type, I can do this....
              local_person.person_id          := select_person_rec.person_id;
              local_person.person_name      := select_person_rec.person_name;
              local_person.person_age          := select_person_rec.person_age;
    -- QUESTION 1
              -- The above works fine, but in my real example there are a lot more fields          
              -- Why cant I set the local record to the value of the cursor record like this below..     
              local_person := select_person_rec;
    -- The above line gives a pl/sql error - expression is of wrong type, (as far as I can see the records are of the same type?)
    -- QUESTION 2
              --Also how do you update an existing record within the original object, I have tried the following but it does not work
              UPDATE incoming_person
              SET          age = (age + 1)
              WHERE     incoming_person.person_id = '123';
    -- The error here is that the table does not exist
         END LOOP;
    END;
    So I hope that you can see from this, I have two problems. The first is that I can store the current cursor record in a local record if I assign each attribute one at a time, but my real example has a large number of attributes. So why can't I just assign the entire cursor record to the local cursor record?
    I get a PL/SQL error "Expression is of wrong type" when I try to do this.
    The second question is with regards to the update statement, obviously this doesn't work, it expects a table name here instead. So can anyone show me how I should update existing person records in the incoming table type to the procedure?
    I hope this makes sense, but I don't think I have explained it very well!!
    Any help will be gratefully recieved!!
    Thanks

    I understand why you are having trouble - my own brain started to hurt looking at your questions :)
    First off, database types are not records. They can act like records but are "objects" with different characterstics.
    You can create a record in PL/SQL but the "type" is of RECORD. You created an OBJECT as BODY_PERSON_RECORD_TYPE.
    I don't use database types unless I really need them, such as for working with pipelined functions.
    -- QUESTION 1
    -- The above works fine, but in my real example there are a lot more fields
    -- Why cant I set the local record to the value of the cursor record like this below..
    local_person := select_person_rec; local_person is set to the (misnamed) BODY_PERSON_RECORD_TYPE, while SELECT_PERSON_REC is anchored to the cursor and is a RECORD of SELECT_PERSON%ROWTYPE with a field for each column selected in the query. Different types, not compatible.
    You should be able to manually assign the object items one by one as object.attribute := record.field one field at a time.
    -- QUESTION 2
    --Also how do you update an existing record within the original object, I have tried the following but it does not workCheck the on-line documentation for the syntax. You'll probably have to reference the actual value through the table; this is one reason why I don't work with nested tables - the syntax to do things like updates is much more complex.

  • Help with oracle 11g pivot operator

    i need some help with oracle 11g pivot operator. is it possible to use multiple columns in the FOR clause and then compare it against multiple set of values.
    here is the sql to create some sample data
    create table pivot_data ( country_code number , dept number, job varchar2(20), sal number );
    insert into pivot_data values (1,30 , 'SALESMAN', 5000);
    insert into pivot_data values (1,301, 'SALESMAN', 5500);
    insert into pivot_data values (1,30 , 'MANAGER', 10000);     
    insert into pivot_data values (1,301, 'MANAGER', 10500);
    insert into pivot_data values (1,30 , 'CLERK', 4000);
    insert into pivot_data values (1,302, 'CLERK',4500);
    insert into pivot_data values (2,30 , 'SALESMAN', 6000);
    insert into pivot_data values (2,301, 'SALESMAN', 6500);
    insert into pivot_data values (2,30 , 'MANAGER', 11000);     
    insert into pivot_data values (2,301, 'MANAGER', 11500);
    insert into pivot_data values (2,30 , 'CLERK', 3000);
    insert into pivot_data values (2,302, 'CLERK',3500);
    using case when I can write something like this and get the output i want
    select country_code
    ,avg(case when (( dept = 30 and job = 'SALESMAN' ) or ( dept = 301 and job = 'SALESMAN' ) ) then sal end ) as d30_sls
    ,avg(case when (( dept = 30 and job = 'MANAGER' ) or ( dept = 301 and job = 'MANAGER' ) ) then sal end ) as d30_mgr
    ,avg(case when (( dept = 30 and job = 'CLERK' ) or ( dept = 302 and job = 'CLERK' ) ) then sal end ) as d30_clrk
    from pivot_data group by country_code;
    output
    country_code          D30_SLS               D30_MGR               D30_CLRK
    1      5250      10250      4250
    2      6250      11250      3250
    what I tried with pivot is like this I get what I want if I have only one ( dept,job) for one alias name. I want to call (30 , 'SALESMAN') or (301 , 'SALESMAN') AS d30_sls. any help how can I do this
    SELECT *
    FROM pivot_data
    PIVOT (SUM(sal) AS sum
    FOR (dept,job) IN ( (30 , 'SALESMAN') AS d30_sls,
              (30 , 'MANAGER') AS d30_mgr,               
    (30 , 'CLERK') AS d30_clk
    this is a simple example .... my real life scenario is compliated with more fields and more combinations .... So something like using substr(dept,1,2) won't work in my real case .
    any suggestions get the result similar to what i get in the case when example is really appreciated.

    Hi,
    Sorry, I don't think there's any way to get exactly what you requested. The values you give in the PIVOT ... IN clause are exact values, not alternatives.
    You could do something like this to map all alternatives to a common value:
    WITH     got_dept_grp     AS
         SELECT     country_code, job, sal
         ,     CASE
                  WHEN  job IN ('SALESMAN', 'MANAGER') AND dept = 301 THEN 30
                  WHEN  job IN ('CLERK')               AND dept = 302 THEN 30
                                                                     ELSE dept
              END     AS dept_grp
         FROM     pivot_data
    SELECT     *
    FROM     got_dept_grp
    PIVOT     (     AVG (sal)
         FOR     (job, dept_grp)
         IN     ( ('SALESMAN', 30)
              , ('MANAGER' , 30)
              , ('CLERK'   , 30)
    ;In your sample data (and perhaps in your real data), it's about as easy to explicitly define the pivoted groups individually, like this:
    WITH     got_pivot_key     AS
         SELECT     country_code, sal
         ,     CASE
                  WHEN  job = 'SALESMAN' AND dept IN (30, 301) THEN 'd30_sls'
                  WHEN  job = 'MANAGER'  AND dept IN (30, 301) THEN 'd30_mgr'
                  WHEN  job = 'CLERK'    AND dept IN (30, 302) THEN 'd30_clrk'
              END     AS pivot_key
         FROM    pivot_data
    SELECT     *
    FROM     got_pivot_key
    PIVOT     (     AVG (sal)
         FOR     pivot_key
         IN     ( 'd30_sls'
              , 'd30_mgr'
              , 'd30_clrk'
    ;Thanks for posting the CREATE TABLE and INSERT statements; that really helps!

  • I need help with oracle

    Hi,
    I need some help... if someone can help its great.
    I need to make a statement in Oracle SQL that read data from a file and insert in a Oracle Database ... if someone can show me the syntax of it i appreciate..
    Thanks

    Okay, I see you followed the advice in that other thread and started a new post for you question. Congratulations. Your next lesson in forum etiquette is to give your posts a more relevant subject. Pretty much everybody who posts here needs help with oracle; if they need help with cooking catfish they've come to the wrong place.
    It that other thread I suggested using SQL*Loader or External Tables might be a more suitable solution. Find out more.
    Cheers, APC

  • Help with opening Adobe Reader and downloading updates

    I can not open Adobe .pdf files any longer (this started yesterday, prior to that I could open adobe files).
    When I double click a .pdf file I get this notice on my screen: Windows cannot access the specified device path or file. You may not have the appropriate permission to access file.
    So I went to the Adobe download site to download a new copy of Adobe.  When I start the download I get this on the screen:  The instruction at "0x0e3a0068" referenced memory at "0x0e3a0068."  The memory could not be written.  Then two options are listed: click OK to terminate or cancel to debug.  So I click on cancel and I get this on my screen: Internet Explorer has closed this webpage to help protect your computer.   A malfunctioning or malicious addon has caused I.E. to close this webpage.
    I don't have AVG running, I do have avast but I've disabled it.  I ran Registry Mechanic and an I.E. erasure program but nothing helps.
    I have gone into I.E. and reduced the security level to its lowest state but no joy.
    So, any ideas or suggestions on what's the problem and how to overcome it would be appreciated.  Thanks, in advance, for your reply.  Jim R.

    Hi Mike..tried that as well but no joy.  A friend of mine was looking at it all and noticed that it was an I.E. thing as far as not letting me redownload the reader so I went to Mozilla Firefox and I could download a new version but....whenever I attempt to open a .pdf file I get that message, "Windows can not open the specified device, path or file. You man not have the appropriate permissions to access the item." 
    Damn...this is irritating as I need to get to some of thos files as I need them for a Journal I'm working on as editor-in-chief. 
    It all worked just fine last Saturday but starting Monday when I was on my flight out to D.C.  no joy. 
    Sigh...Jim R.
    Jim R.
    Date: Tue, 1 Dec 2009 14:50:27 -0700
    From: [email protected]
    To: [email protected]
    Subject: Help with opening Adobe Reader and downloading updates
    Under the help menu, there is an option to repair the installation of reader. Did you try that?
    >

  • Need help with my iPhone 5 and my Macbook Pro.

    Need help with my iPhone 5 and my Macbook Pro.  I was purchased some music on itunes at my mac. Some reason I deleted those music from both on Mac and iPhone 5.  Today, I went to my iPhone iTunes store inside of iCloud to redownload my puchased. But those song won't able to sync back to my iTunes library on my Mac.  Can anyone help me with that ??....
    iPhone 5, iOS 6.0.1

    You've posted to the iTunes Match forum, which your question does not appear to be related to. You'll get better support responses by posting to either the iTunes for Mac or iTunes for Windows forum. Which ever is more appropriate for your situation.

  • Barbara Brundage, can you help with PS Elements 11 and Epson R2000 printer issue?

    Seeking help with PS Elements 11 which does not work with Epson r2000 printer.  Epson tech support could not fix, said it is PS e11 problem.  Receive prompt on PS e11 screen when I try to print stating "not compatible or settings are not correct.  Have set PS to manage color and printer manages color to off.  Would appreciate any suggestions.  Thank you.

    Hi,
    Sincerely appreciate your help.  Running Windows 7 on a  Dell XPS420.  System has been very stable for years.  Before purchasing the Epson r2000, I owned an r1800 which was an excellent printer but after seven years started to exhibit paper feed problems.  The r1800 worked with all applications and I was well satisfied with the saturation, contrast, etc. printing mostly 8x10 and 11x17 prints. 
    Thank you for the information about the # of installs for PS E11, will try uninstall/reinstall this morning.
    Will let you know how things go.
    Richard
    Date: Thu, 12 Sep 2013 19:47:38 -0700
    From: [email protected]
    To: [email protected]
    Subject: Barbara Brundage, can you help with PS Elements 11 and Epson R2000 printer issue?
        Re: Barbara Brundage, can you help with PS Elements 11 and Epson R2000 printer issue?
        created by Barbara B. in Photoshop Elements - View the full discussion
    What operating system are you using?
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5678022#5678022
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5678022#5678022
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5678022#5678022. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop Elements by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • New help with my mac air and airport extreme time capsule dont know how to save to time capsule and use as a external hd

    new help with my mac air and airport extreme time capsule dont know how to save to time capsule and use as a external hd would like 2 store my home videos and pictures on the time machine (ONLY) as the MAC AIR has storage space limited space please help. THANK YOU.

    See the info here about sharing or using the TC for data.
    Q3 http://pondini.org/TM/Time_Capsule.html
    It is extremely important you realise.. the Time Capsule was never designed for this.
    It is a backup target for Time Machine.. that is the software on the computer that does backups.. it has no direct connection to the Time Capsule.
    It has no ability to back itself up.. unlike all other NAS in the market. It is therefore likely one day you will lose all your files unless you seriously work out how to backup.
    The TC is slow to spin up the hard disk and fast to spin down. iTunes and iPhoto will continually lose connection to their respective libraries.
    iPhoto in particular is easy to corrupt when you move photos over wireless into the library.. once corrupted all is corrupt. A single photo will ruin it all.. so backup is utterly essential.
    Time Machine cannot do backups of network drives. ie the TC. You will need a different backup software like CCC. You will then need another target to backup to..

  • Supplemental logging with Oracle 10gR2 Streams and Data Guard

    Hello,
    I have a environment with Oracle DB 10gR2 and Physical Standby with Data Guard DR Conf. Right now, this environment is going to be extended to a replication schema using 2-way Oracle Streams Replication (for replication to the central office from this branch office, other branchs will be added soon). The primary DB will be replicated to the other primary DB (in the remote central office).
    So, there is my question: It's completly necesary to specify Supplemental Logging on the sources databases (primaries) for setting 2-way Streams Replication?, and, if it's completly necesary, then, do I can set Supplemental Logging on primaries without affect theirs physical standbys, or do I need to do something special?
    Thanks in advance.

    Sorry, it's repeated. 'cus browser connection problem.

  • VS2010, Entity Framework, and TNS Less connection strings

    I am playing around with the Oracle 11g ODP.NET stuff and the Visual Studio 2010 integration. I am trying to create and entity data model, but I am connecting to a RAC cluster with a TNS Less connection string (Example at bottom). Previously I've had to use Oracle's OLE DB drivers to connect, however I would love to be able to leverage the Entity Framework in my next project. When I go to create a new connection in my VS project, the Connection Properties dialog pops up with option to choose the Data Source. I choose Oracle, but then I don't see a way to connect in the way that I have to. Any help would be appreciated. Thank you.
    Connection String Example:
    Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = someHost.prod.someDomain.net)(PORT = 9991)) (ADDRESS = (PROTOCOL = TCP)(HOST = someHost2.prod.someDomain.net)(PORT = 9991)) (ADDRESS = (PROTOCOL = TCP)(HOST = someHost3.prod.someDomain.net)(PORT = 9991)) (ADDRESS = (PROTOCOL = TCP)(HOST = someHost4.prod.someDomain.net)(PORT = 9991)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = myService.myDomain.com)));User Id=myUser;Password=myPassword;

    Hello cshay, you're right, I had the wrong version installed. I'm sure I selected the beta first, but I suppose I downloaded the stable version after creating my Oracle account.
    Thanks cshay, and sorry to bother you all with such a question!

  • Help with Oracle Connection- "Input string was not in a correct format"

    Hello, can some one, anyone please help me. I have a simple VS 2005 C# application that connects to oracle. I've set it up to take the username, password and tnsname as arguments. I am using Client 9i, version 9.2.0.401 of Oracle.DataAccess.dll, and .NET Framework 2.0.
    It works fine when I run it from VS 2005, I have also set up a test machine w/o VS 2005 and ran my install package and it runs fine. I sent it to one of my co-workers and when he tries it the OracleConnection obect fails with the error.
    "Input string was not in a correct format"
    strange in that it is not an ORA error, just the identifed text!?
    Here is the code:
    ## begin code
    OracleConnection dbc = new OracleConnection();
    string sConnectString = "User Id=" + username.ToString() + ";Password=" + password.ToString() + ";Data Source=" + tnsname.ToString();
    dbc.ConnectionString = sConnectString.ToString();
    MessageBox.Show("Attempting to Connect to Oracle");
    dbc.Open();
    MessageBox.Show("Connected to Oracle: " + dbc.ServerVersion);
    ## end code
    Pretty basic, what could be going on?
    Since this only happens with an installation, I put in the message boxes to verify exactly where it chokes. I get the first message box, then an error with the identified text. I've seen a number of posts regarding input string format problems, but not a one dealing with OracleConnection.Open(). I added all the ToString() calls just to make sure everything was a string but it did not change the end result.
    Anyone? Thanks In advance!
    Eric S.

    Hello,
    well, i got a message "...string not wellformed format...", too.
    If you have defined the parameters as string, you don't need the additonal "ToString()". Please ckeck your tnsnames -string. Try to debug this. I believe you have copy the format from the tnsnames.ora and there you have much brackets.
    For example, two code snippets:
    As datasource i use <Server>:<Port>/<Instance>
    try
    string FDsn ="User Id="+FDbUser+";Password="+FDbPwd;
    FDsn +=";Data Source=wth5:1521/Ora9.wth5";
    FConn = new OracleConnection(FDsn);
    FConn.Open();
    if (FConn.State == ConnectionState.Open )
         FConn.Close();
    catch (Exception ex)
         FStateMsg = "Connection to database failed. Check Configuration in parameter: ConnectionString. " + ex.Message;
    Above i connect to a Ora 9.2.0.1
    by using
    FDsn +=";Data Source=wth5:1522/XE";
    i connect to an OraExpress database on the same machine.
    My Oracle.dataAccess.dll ist the newest, 10.2.... and it runs under Framework 1.1.x and Framework 2.x
    I'll hope it will help you. Best regards!

  • Help with: oracle.toplink.essentials.exceptions.ValidationException

    hi guys,
    I really need ur help with this.
    I have a remote session bean that retrieves a list of books from the database using entity class and I call the session bean from a web service. The problem is that when i display the books in a jsp directly from the session bean everything works ok but the problem comes when I call the session bean via the web service than it throws this:
    Exception Description: An attempt was made to traverse a relationship using indirection that had a null Session. This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization. To avoid this issue, instantiate the LAZY relationship prior to serialization.
    at oracle.toplink.essentials.exceptions.ValidationException.instantiatingValueholderWithNullSession(ValidationException.java:887)
    at oracle.toplink.essentials.internal.indirection.UnitOfWorkValueHolder.instantiate(UnitOfWorkValueHolder.java:233)
    at oracle.toplink.essentials.internal.indirection.DatabaseValueHolder.getValue(DatabaseValueHolder.java:105)
    at oracle.toplink.essentials.indirection.IndirectList.buildDelegate(IndirectList.java:208)
    at oracle.toplink.essentials.indirection.IndirectList.getDelegate(IndirectList.java:330)
    at oracle.toplink.essentials.indirection.IndirectList$1.<init>(IndirectList.java:425)
    at oracle.toplink.essentials.indirection.IndirectList.iterator(IndirectList.java:424)
    at com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:278)
    at com.sun.xml.bind.v2.runtime.reflect.Lister$CollectionLister.iterator(Lister.java:265)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:129)
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:277)
    at com.sun.xml.bind.v2.runtime.BridgeImpl.marshal(BridgeImpl.java:100)
    at com.sun.xml.bind.api.Bridge.marshal(Bridge.java:141)
    at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:315)
    at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142)
    at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:108)
    at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
    at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:320)
    at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:93)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:176)
    ... 29 more
    This happens when I test the web service using netbeans 6.5.
    here's my code:
    session bean:
    ArrayList bookList = null;
    public ArrayList retrieveBooks()
    try
    List list = em.createNamedQuery("Book.findAll").getResultList();
    bookList = new ArrayList(list);
    catch (Exception e)
    e.getCause();
    return bookList;
    web service:
    @WebMethod(operationName = "retrieveBooks")
    public Book[] retrieveBooks()
    ArrayList list = ejbUB.retrieveBooks();
    int size = list.size();
    Book[] bookList = new Book[size];
    Iterator it = list.iterator();
    int i = 0;
    while (it.hasNext())
    Book book = (Book) it.next();
    bookList[i] = book;
    i++;
    return bookList;
    Please help guys, it's very urgent

    Yes i have a relationship but i didnt want it to be directly. Maybe this is a design problem but in my case I dont expect any criminals to be involved in lawsuit. My tables are like that:
    CREATE TABLE IF NOT EXISTS Criminal(
         criminal_id INTEGER NOT NULL AUTO_INCREMENT,
         gender varchar(1),
         name varchar(25) NOT NULL,
         last_address varchar(100),
         birth_date date,
         hair_color varchar(10),
         eye_color varchar(10),
         weight INTEGER,
         height INTEGER,
         PRIMARY KEY (criminal_id)
    ENGINE=INNODB;
    CREATE TABLE IF NOT EXISTS Lawsuit(
         lawsuit_id INTEGER NOT NULL AUTO_INCREMENT,
         courtName varchar(25),
         PRIMARY KEY (lawsuit_id),
         FOREIGN KEY (courtName) REFERENCES Court_of_Law(courtName) ON DELETE NO ACTION
    ENGINE=INNODB;
    CREATE TABLE IF NOT EXISTS Rstands_trial(
         criminal_id INTEGER,
         lawsuit_id INTEGER,
         PRIMARY KEY (criminal_id, lawsuit_id),
         FOREIGN KEY (criminal_id) REFERENCES Criminal(criminal_id) ON DELETE NO ACTION,
         FOREIGN KEY (lawsuit_id) REFERENCES Lawsuit(lawsuit_id) ON DELETE CASCADE
    ENGINE=INNODB;So I couldnt get it.

  • Seeding multiple databases with single Entity Framework context

    I am developing a single-instance, multi-tenant web application, with a SQL database using Entity Framework 6 Code-First. 
    I want to have a separate database for each client, generated from the same EF models, with a single DbContext. The database to connect to will be determined by the subdomain that the client is using the web app from. 
    This seems to work fine and the correct database is connected to depending on the subdomain. However my issue is seeding the databases with data. This is the code I have:
    foreach (var connString in ConfigurationManager.ConnectionStrings.Cast<ConnectionStringSettings>()))
    Configuration.PerformDatabaseMigration(connString.Name);
    This then calls the PerformDatabaseMigration method: 
    public class Configuration : DbMigrationsConfiguration<DataContext>
    public Configuration()
    AutomaticMigrationsEnabled = false;
    AutomaticMigrationDataLossAllowed = false;
    public static void PerformDatabaseMigration(string connStringName)
    var databaseInitialiser = new Configuration { TargetDatabase = new DbConnectionInfo(connStringName) };
    var dbMigrator = new DbMigrator(databaseInitialiser);
    dbMigrator.Update();
    protected override void Seed(DataContext context)
    base.Seed(context);
    var superAdmin = new User { Id = 1, UserName = "SuperAdmin" };
    context.Users.AddOrUpdate(superAdmin);
    The issue is that when seeding this data for the second database, the context passed into the Seed method already has the admin user added to the `DbSet<User>` property of the context, even though the context is for the second databse connection, not
    the first. It appears that the context is not being cleared from seeding the first database, and so I receive a `DbUpdateException`, as my User.Username field is a unique index.
    Cannot insert duplicate key row in object 'dbo.Users' with unique index 'IX_UserName'. The duplicate key value is (SuperAdmin).\r\nThe statement has been terminated.
    public class User : ModelBase, IUserIdentity, IPrincipal, IIdentity 
        [Index(IsUnique = true)]     
      [Required]     
      [StringLength(40)]       
    public string UserName { get; set; }

    Hello Attune,
    >>This seems to work fine and the correct database is connected to depending on the subdomain. However my issue is seeding the databases with data.
    Is that you firstly create these databases and then call the PerformDatabaseMigration method to seed these database with data? Do you have a try to seed these database data when creating the database with AutomaticMigrationsEnabled = true; with your provided
    configuration class, I tested it and it could work as seeding same data to different database:
    internal sealed class Configuration : DbMigrationsConfiguration<CFs.CFContext>
    public Configuration()
    AutomaticMigrationsEnabled = true;
    public static void PerformDatabaseMigration(string connStringName)
    var databaseInitialiser = new Configuration { TargetDatabase = new DbConnectionInfo(connStringName) };
    var dbMigrator = new DbMigrator(databaseInitialiser);
    dbMigrator.Update();
    protected override void Seed(CFs.CFContext context)
    base.Seed(context);
    var superAdmin = new ApplicationUser() { ApplicationUserID = 1, FirstName = "", LastName = "" };
    context.ApplicationUsers.AddOrUpdate(superAdmin);
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for