How can I update the storage model from database?
I'm evolving the database schema in parallel with conceptual model, I know I can edit the storage model, but in some case it would be better to load updates directly from database (most of all for foreign keys constraints).
Thanks
Search found 29 matches
- Fri 05 Jun 2009 13:52
- Forum: Entity Framework support
- Topic: Enity Developer: update storage model from database
- Replies: 1
- Views: 2423
- Fri 05 Jun 2009 10:20
- Forum: Entity Framework support
- Topic: incomplete MetadataWorkspace?
- Replies: 3
- Views: 2947
When I want to enumerate all the types defined in the storage model I use the following query:
I always get an exception. If I use DataSpace.CSpace (for conceptual model) the query works fine.
Thanks
Code: Select all
var query =
from item in
context.MetadataWorkspace.GetItems(DataSpace.SSpace)
.Where(m => m.BuiltInTypeKind == BuiltInTypeKind.EntityType)
select item;
Thanks
- Thu 04 Jun 2009 21:19
- Forum: Entity Framework support
- Topic: incomplete MetadataWorkspace?
- Replies: 3
- Views: 2947
incomplete MetadataWorkspace?
Hello, I'm digging into ObjectContext.MetadataWorkspace.
everything is fine when I query the conceptual model via DataSpace.CSpace.
But I always receive an error when i query for the storage model via DataSpace.SSpace (exception says "System.InvalidOperationException: The space 'SSpace' has no associated collection").
Can you tell me something about this error?
Thanks
everything is fine when I query the conceptual model via DataSpace.CSpace.
But I always receive an error when i query for the storage model via DataSpace.SSpace (exception says "System.InvalidOperationException: The space 'SSpace' has no associated collection").
Can you tell me something about this error?
Thanks
- Thu 04 Jun 2009 14:25
- Forum: Entity Framework support
- Topic: entity developer error in code generation
- Replies: 1
- Views: 2537
entity developer error in code generation
I haven't yet understand how Entity Developer works with code generation.
I have DataSourceModel.edml, so I also have DataSourceModel.cs and DataSourceModel.Designer.cs.
Why the two files contains the same code when I compile the model in Entity Developer? this is a problem when compiling in Visual Studio (ambiguos definitions).
Am I wrong somewhere?
Thanks
I have DataSourceModel.edml, so I also have DataSourceModel.cs and DataSourceModel.Designer.cs.
Why the two files contains the same code when I compile the model in Entity Developer? this is a problem when compiling in Visual Studio (ambiguos definitions).
Am I wrong somewhere?
Thanks
- Wed 27 May 2009 15:04
- Forum: dotConnect for Oracle
- Topic: EntityFramework, Oracle, and Guid as PrimaryKey - HOWTO?
- Replies: 1
- Views: 2759
- Thu 16 Apr 2009 14:40
- Forum: Entity Framework support
- Topic: different behaviour in direct=false mode
- Replies: 10
- Views: 4536
different behaviour in direct=false mode
I have a very simple test
33 times is not a guess...
in direct=true mode it works (and it works even with a higher number of times: 200, 500, ...).
in direct=false mode it doesn't work: the maximum number of times is 32 (why 32???) to work properly
The error I get is: ORA-02045: too many local sessions participating in global transaction.
the connection string in direct=false mode refers to a configured service in tsnames.ora file (Oracle client configuration).
Why a so remarkable difference between the two?
I think it's unacceptable: the database is phisically the same, and there are scenarios in which i cannot use the direct=true connection mode (for example an Oracle RAC configuration in load balance, that needs a connection via tsnames.ora with a particular configuration).
I use the latest library (5.00.26).
Code: Select all
[TestMethod]
public void TestMaxNumberOfObjectContetxtInTransactionScope()
{
using (TransactionScope ts =
this.GetTransactionScope(TransactionScopeOption.Required, IsolationLevel.ReadCommitted))
{
for (int i = 0; i < 33; i++)
{
using (TSObjectContext context = new TSObjectContext())
{
Guid id = Guid.NewGuid();
string description = Guid.NewGuid().ToString();
TestData newTestData = TestData.CreateTestData(id);
newTestData.Description = description;
context.AddToTestDataSet(newTestData);
context.SaveChanges();
}
}
ts.Complete();
}
}
in direct=true mode it works (and it works even with a higher number of times: 200, 500, ...).
in direct=false mode it doesn't work: the maximum number of times is 32 (why 32???) to work properly
The error I get is: ORA-02045: too many local sessions participating in global transaction.
the connection string in direct=false mode refers to a configured service in tsnames.ora file (Oracle client configuration).
Why a so remarkable difference between the two?
I think it's unacceptable: the database is phisically the same, and there are scenarios in which i cannot use the direct=true connection mode (for example an Oracle RAC configuration in load balance, that needs a connection via tsnames.ora with a particular configuration).
I use the latest library (5.00.26).
- Tue 24 Mar 2009 13:23
- Forum: Entity Framework support
- Topic: MSSQL + Oracle
- Replies: 16
- Views: 5768
- Mon 09 Mar 2009 09:34
- Forum: Entity Framework support
- Topic: Transaction Scope and multithread
- Replies: 4
- Views: 4056
Transaction Scope and multithread
Hello,
I have a WCF service and I have a problem with TransactionScope when connection is not in direct mode (Direct=False).
I have something like this:
when there are multiple concurrent threads it works only in direct=true connection mode, in direct=false connection mode all the transactions fail. It seems that in direct=false connection mode transactions are merged in some way even if TransactionScopeOption.RequiresNew flag.
Thanks for your support.
I have a WCF service and I have a problem with TransactionScope when connection is not in direct mode (Direct=False).
I have something like this:
Code: Select all
TransactionOptions transactionOptions = new TransactionOptions();
transactionOptions.IsolationLevel = IsolationLevel.ReadCommitted;
transactionOptions.Timeout = new TimeSpan(0, 0, 30);
using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew, transactionOptions))
{
using (SomeObjectContext someObjectContext = new SomeObjectContext())
{
...
someObjectContext.SaveChanges();
}
transactionScope.Complete();
}
Thanks for your support.
- Thu 12 Feb 2009 11:07
- Forum: Entity Framework support
- Topic: Transaction Scope exception in a simple scenario
- Replies: 4
- Views: 5180
- Thu 12 Feb 2009 07:59
- Forum: Entity Framework support
- Topic: Transaction Scope exception in a simple scenario
- Replies: 4
- Views: 5180
I have to make an update on what I say in the first post:
the exception is thrown not on ts.Complete(), but on disposing the TransactionScope.
The following test code do not use the "using" keyword and call the Dispose method:
On ts.Dispose() the provider throws the exception I quoted in the first post. The same code (without using keyword) works fine in SQLServer.
Thanks.
the exception is thrown not on ts.Complete(), but on disposing the TransactionScope.
The following test code do not use the "using" keyword and call the Dispose method:
Code: Select all
[TestMethod]
public void TransactionScopeWithSimpleInsert()
{
try
{
TransactionScope ts = null;
try
{
ts = new TransactionScope();
TSObjectContext context = null;
try
{
context = new TSObjectContext();
TestData testData =
context.TestDataSet
.First();
Guid id = Guid.NewGuid();
TestData newTestData = TestData.CreateTestData(id);
newTestData.Description = testData.Description;
context.AddToTestDataSet(newTestData);
context.SaveChanges();
}
catch (Exception)
{
throw;
}
finally
{
if (context != null)
{
context.Dispose();
}
}
ts.Complete();
}
catch (Exception)
{
throw;
}
finally
{
if (ts != null)
{
ts.Dispose();
}
}
}
catch (Exception ex)
{
Assert.Fail(ex.Message);
}
}
Thanks.
- Wed 11 Feb 2009 22:33
- Forum: Entity Framework support
- Topic: Transaction Scope exception in a simple scenario
- Replies: 4
- Views: 5180
Transaction Scope exception in a simple scenario
Hello,
I'm starting to think that TransactionScope has some problem with dotConnect for Oracle 5.00.20.
I have a very simple test in which I read an object and insert another one with the same description:
this test throw an exception on ts.Complete():
Why it fails with Oracle?
This is a very simple test, am I wrong somewhere?
Thanks.
I'm starting to think that TransactionScope has some problem with dotConnect for Oracle 5.00.20.
I have a very simple test in which I read an object and insert another one with the same description:
Code: Select all
[TestMethod]
public void TransactionScopeWithSimpleInsert()
{
try
{
using (TransactionScope ts = new TransactionScope())
{
TSObjectContext context = null;
try
{
context = new TSObjectContext();
TestData testData =
context.TestDataSet
.First();
Guid id = Guid.NewGuid();
TestData newTestData = TestData.CreateTestData(id);
newTestData.Description = testData.Description;
context.AddToTestDataSet(newTestData);
context.SaveChanges();
}
catch (Exception)
{
throw;
}
finally
{
if (context != null)
{
context.Dispose();
}
}
ts.Complete();
}
}
catch (Exception ex)
{
Assert.Fail(ex.Message);
}
}
the same test works without any problem with SQLServer, and honestly I don't see any reason why it shouldn't work.The operation is not valid for the current state of the enlistment.
System.InvalidOperationException
at System.Transactions.EnlistmentState.ForceRollback(InternalEnlistment enlistment, Exception e)
at System.Transactions.PreparingEnlistment.ForceRollback()
at Devart.Data.Oracle.h.a(PreparingEnlistment A_0)
at System.Transactions.VolatileEnlistmentPreparing.EnterState(InternalEnlistment enlistment)
at System.Transactions.VolatileEnlistmentActive.ChangeStatePreparing(InternalEnlistment enlistment)
at System.Transactions.TransactionStateVolatilePhase1.EnterState(InternalTransaction tx)
at System.Transactions.TransactionStatePhase0.EnterState(InternalTransaction tx)
at System.Transactions.TransactionStateActive.BeginCommit(InternalTransaction tx, Boolean asyncCommit, AsyncCallback asyncCallback, Object asyncState)
at System.Transactions.CommittableTransaction.Commit()
at System.Transactions.TransactionScope.InternalDispose()
at System.Transactions.TransactionScope.Dispose()
at TestDevArtTransatcionScope.TestSuite.TransactionScopeTestCase.TransactionScopeWithSimpleInsert()
Why it fails with Oracle?
This is a very simple test, am I wrong somewhere?
Thanks.
- Fri 06 Feb 2009 08:56
- Forum: Entity Framework support
- Topic: Transaction Scope and Invalid SID error
- Replies: 4
- Views: 6370
Just a few details:
the problem isn't the SID name, the SID is correct, the connection is in direct mode.
The problem, more precisely, is:
in a transaction scope everything goes well until the number of queries is low, if the number of queries increases (there's no rule about how many), the provider starts to raise the invalid sid exception.
with query I mean a using statement with a new objectcontext (so in the transaction scope you have several times a creation and a dispose of an objectcontext).
As you suggest I sent you an email with the project
Thanks
the problem isn't the SID name, the SID is correct, the connection is in direct mode.
The problem, more precisely, is:
in a transaction scope everything goes well until the number of queries is low, if the number of queries increases (there's no rule about how many), the provider starts to raise the invalid sid exception.
with query I mean a using statement with a new objectcontext (so in the transaction scope you have several times a creation and a dispose of an objectcontext).
As you suggest I sent you an email with the project
Thanks
- Wed 04 Feb 2009 14:34
- Forum: Entity Framework support
- Topic: Transaction Scope and Invalid SID error
- Replies: 4
- Views: 6370
Transaction Scope and Invalid SID error
Hello,
Entity Framework based on dotConnect for Oracle 5.00.20, Oracle Express 10g, Windows 2003 Server, DTC service.
I have a WCF service method that starts a transaction with TransactionScope.
During transaction it recalls several other services that start an ObjectContext each. I receive always an exception which says "NET: Invalid SID".
I made a small project with a test to reproduce the situation, and I got always the same error: during transaction, after some ObjectContext creations, at SaveChenges it seems the provider cannot open the connection and throws that exception.
Thanks
Entity Framework based on dotConnect for Oracle 5.00.20, Oracle Express 10g, Windows 2003 Server, DTC service.
I have a WCF service method that starts a transaction with TransactionScope.
During transaction it recalls several other services that start an ObjectContext each. I receive always an exception which says "NET: Invalid SID".
I made a small project with a test to reproduce the situation, and I got always the same error: during transaction, after some ObjectContext creations, at SaveChenges it seems the provider cannot open the connection and throws that exception.
Thanks
- Mon 12 Jan 2009 13:55
- Forum: Entity Framework support
- Topic: mapped stored procedures disappear
- Replies: 5
- Views: 3573
Hello,
I understand why the SP disappeared: I took a look into the xml of edmx file and I found:
Errors Found During Generation: warning 6005: The function 'CREATESECTION' has a parameter 'V_MENUVISIBILITY' at parameter index 5 that has a data type 'PL/SQL BOOLEAN' which is not supported, the function was excluded.
I have to say:
first, BOOLEAN is perfectly legal in PL\SQL, even if there's no such data type name for table fields, boolean in table fields must be NUMBER(1,0)
second, the SP mapped for CRUD, with BOOLEAN in parameters, works perfectly with your data provider for EF, so I don't understand why the designer alerts an error this way.
thanks
I understand why the SP disappeared: I took a look into the xml of edmx file and I found:
Errors Found During Generation: warning 6005: The function 'CREATESECTION' has a parameter 'V_MENUVISIBILITY' at parameter index 5 that has a data type 'PL/SQL BOOLEAN' which is not supported, the function was excluded.
I have to say:
first, BOOLEAN is perfectly legal in PL\SQL, even if there's no such data type name for table fields, boolean in table fields must be NUMBER(1,0)
second, the SP mapped for CRUD, with BOOLEAN in parameters, works perfectly with your data provider for EF, so I don't understand why the designer alerts an error this way.
thanks
- Fri 09 Jan 2009 16:52
- Forum: Entity Framework support
- Topic: mapped stored procedures disappear
- Replies: 5
- Views: 3573