Search found 30 matches

by Nahmis
Tue 15 Jun 2010 18:31
Forum: dotConnect for Oracle
Topic: Specified method is not supported - Extension Method
Replies: 4
Views: 3045

Specified method is not supported - Extension Method

We have a short extension method used that breaks when used in a subquery, first off here's the method:

Code: Select all

		public static IQueryable Current(this IQueryable source)
		{
			var entParam = Expression.Parameter(typeof(TSource), "ent");
			var entParam2 = Expression.Parameter(typeof(TSource), "ent");
			return source
				.Where(
					Expression.Lambda>(
						Expression.Equal(Expression.Property(entParam, typeof(TSource).GetProperty("EntityId")), 
                                                       Expression.Constant(0L)), new[] { entParam }))
				.Where(
					Expression.Lambda>(
						Expression.Equal(Expression.Property(entParam2, typeof(TSource).GetProperty("RecordStatus")), 
                                                       Expression.Constant(0L)), new[] { entParam2 }));
		}
It's just a short way for us to filter out older/deleted records since it's done quite often, but there's an issue. For example, this works:

Code: Select all

var contacts = from c in DB.Contacts.Current()
               where !(from u in DB.Users
			           select u.ContactId).Contains(c.Id)
               select c.Id;
However using our .Current() extension method inside that subquery doesn't, like this:

Code: Select all

var contacts = from c in DB.Contacts.Current()
               where !(from u in DB.Users.Current()
			           select u.ContactId).Contains(c.Id)
               select c.Id;
This results in:
Specified method is not supported.
at Devart.Data.Linq.Provider.Query.x.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.x.d(Expression A_0, Expression A_1)
at Devart.Data.Linq.Provider.Query.x.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0, Expression A_1)
at Devart.Data.Linq.Provider.Query.x.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.a(UnaryExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.a(Expression A_0, LambdaExpression A_1)
at Devart.Data.Linq.Provider.Query.x.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.d(Expression A_0, Expression A_1)
at Devart.Data.Linq.Provider.Query.x.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.x.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.x.i(Expression A_0)
at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.GetCommand(Expression query)
at Devart.Data.Linq.DataContext.GetCommand(IQueryable query)
It seems that this should work both places since it's expression based. These two should be equivalent:

Code: Select all

var contacts = from c in DB.Contacts.Current()
               where !(from u in DB.Users.Current()
			           select u.ContactId).Contains(c.Id)
               select c.Id;

Code: Select all

var contacts = from c in DB.Contacts.Current()
               where !(from u in DB.Users
                       where u.EntityId == 0 && e.RecordStatus == 0
			           select u.ContactId).Contains(c.Id)
               select c.Id;
The second does work of course, and generates the following:

Code: Select all

SELECT t1.ID
FROM CONTACT t1
WHERE (NOT (EXISTS
    (
        SELECT t2.CONTACT_ID AS "ContactId"
        FROM USERS t2
        WHERE (t2.CONTACT_ID = t1.ID) AND (t2.ENTITY_ID = :p0) AND (t2.RECORD_STATUS = :p1)
        )
    )) AND (t1.RECORD_STATUS = :p2) AND (t1.ENTITY_ID = :p3)
Is the problem with my expressions, or a bug inside dotConnect not translating it correctly? This would eliminate a lot of extra code every time we have a subquery, any insight/solution would be much appreciated. Thanks!
by Nahmis
Mon 24 May 2010 17:58
Forum: dotConnect for Oracle
Topic: Union/Concat bug in 5.70 release
Replies: 2
Views: 1155

Union/Concat bug in 5.70 release

First, thanks for the 5.70 updates, aside from what I'm about to post, this resolved every current issue we have (and that Enum announcement is very welcomed!)

Here's a simplified query demonstrating the issue:

Code: Select all

var docs = (from d in DB.Documents
            select new { d.Id, Role = d.DocumentName })
    .Concat(from d in DB.Documents
            select new { d.Id, Role = d.DocumentType });

var data = from d in DB.Documents
           join doc in docs on d.Id equals doc.Id
           select new {
               d.Id,
               ContactRole = doc.Role
           };
This generates the following SQL:

Code: Select all

SELECT t1.ID AS "Id", t2."DocumentType" AS "Role"      --should be t2."DocumentName" or t2."Role" 
FROM DOCUMENT t1
INNER JOIN (
    (
        SELECT t3.ID AS "Id", t3.DOCUMENT_NAME AS "DocumentName"
        FROM DOCUMENT t3
        )
    UNION ALL
    (
        SELECT t4.ID AS "Id", t4.DOCUMENT_TYPE AS "DocumentType"
        FROM DOCUMENT t4
        )
    ) t2 ON t1.ID = t2."Id"
The problem is it's trying to use the last concatenated query's columns for use in the overall query (we tested this with more queries, always the last one is used in this way), resulting in this error:

Code: Select all

Message ORA-00904: "T2"."DocumentType": invalid identifier
  
StackTrace    at xc.u.d()
   at Devart.Data.Oracle.bi.c()
   at Devart.Data.Oracle.q.a(Int32 A_0, a4 A_1)
   at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
   at Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery, Object[] parentArgs, Object[] userArgs, Object lastResult)  
It needs to either use the first query's columns that oracle is expecting, or (even better in my opinion) use the name from the anonymous type I assigned, Role in this case. If you guys get a chance to fix this, I'd be happy to test, thanks!
by Nahmis
Fri 14 May 2010 17:18
Forum: dbForge for Oracle
Topic: VS.NET 2010: supported ?
Replies: 7
Views: 3504

Has there been any update on or time frame for this?

Currently the only reason I'm opening VS 2008 is to run queries, would be great to have everything moved over to 2010...the new IDE is a much better/faster experience.
by Nahmis
Tue 13 Apr 2010 15:17
Forum: Entity Developer
Topic: Feature Request: Template File Locations/Definitions
Replies: 3
Views: 2009

Thanks Andrey, completely missed the editor, very nice work on the integration. I'll keep scanning the release notes for the relative file path, this would be a most welcome addition, it's the last bit of friction left on the integration.

As always, you guys provide excellent support.
by Nahmis
Fri 09 Apr 2010 19:01
Forum: Entity Developer
Topic: Feature Request: Template File Locations/Definitions
Replies: 3
Views: 2009

Feature Request: Template File Locations/Definitions

Moved this from the Oracle forum, realized it would be much more productive here:

First, your T4 Template change was excellent and I applaud the changes made to Entity Developer, it's improved immensely since our purchase of dotConnect. Since we have a custom template, being able to compare your templates between releases and quickly update our custom one has saved a tremendous amount of time.

Now for the request: Currently we can't move completely out of Entity Developer and into Visual Studio because of how the templates are defined (at least, as far as I can tell...please correct me if I'm wrong). The reason is that the Templates you can choose to generate from example: LINQ C# or LINQ VB...this model doesn't work so well if you're using a custom template and source control.

If the DataContext .edps file could have the option to point straight at a the .tmpl file instead of relying on available templates defined elsewhere (as far as I can tell, only via Entity Developer). A bonus would be if this file could work with a .t4 extension just the same, it would work in the T4 template editing engine we use inside Visual Studio 2008 (unless you already have future plans to provide the engine that is in Entity Developer inside Visual Studio, which would also be a great solution).

Further, this reference would have work as a relative file path (to the model hopefully). For example right now I use this path: C:\Projects\... and a coworker uses C:\Development\.... While this works fine for everything else because source control systems exclusively use relative paths...it breaks because the template, also in source control, is in 2 different absolute paths on our machines.

Thanks for the great support guys, if a change like this could land in a future release it would make your model fully "source-controllable" which would be a huge plus from our view, hopefully for other potential customers as well.
by Nahmis
Tue 16 Mar 2010 20:33
Forum: dotConnect for Oracle
Topic: Nested .Union() & .Concat() - NotSupportedException
Replies: 8
Views: 3337

Is there any update on this? We are still awaiting a fix and haven't received any response on here on in email...
by Nahmis
Mon 15 Mar 2010 15:08
Forum: dotConnect for Oracle
Topic: Nested .Union() & .Concat() - NotSupportedException
Replies: 8
Views: 3337

We had to re-write the application to work around this bug since we still have not received the build. In the future could you alert us it will be a few days at least? We waited for the build hoping it would resolve it, but since we never received anything, had to work the weekend to cope with the bug.

This is becoming a major pain point for us, since we can't do any sort of complex querying from multiple sources. When will a build be available that resolves this?
by Nahmis
Fri 12 Mar 2010 12:26
Forum: dotConnect for Oracle
Topic: Nested .Union() & .Concat() - NotSupportedException
Replies: 8
Views: 3337

Andrey - When will this Build be available? We're at our deadline and must start re-writing to batch all these operations if there isn't a fix available...hoping there's some way to get a build ASAP.

I'm hoping we don't have to write a bunch of extra code to work around a bug you guys have already fixed, would be nice to get even just the bare DLLs so we can run this thing, is this possible?
by Nahmis
Wed 03 Mar 2010 14:37
Forum: dotConnect for Oracle
Topic: Nested .Union() & .Concat() - NotSupportedException
Replies: 8
Views: 3337

Any update on a fix for this issue?

I need to know if we need to start going through and batching results in 1000s and using .Contains() to work about this as it will take some time to switch over...hoping there's a way to get a fix for this sooner though, would save a lot of throw-away work.

Thanks
by Nahmis
Thu 25 Feb 2010 13:46
Forum: dotConnect for Oracle
Topic: Cannot refresh Entity - Record does not exist - 5.55.97
Replies: 5
Views: 1685

Cannot refresh Entity - Record does not exist - 5.55.97

Making no changes to our model, etc, we're getting this since upgrading from 5.35.57 to any version above (tested 3 releases including lastest 5.55.97 beta, this is the last version it worked), we're now getting this stack:

Code: Select all

System.InvalidOperationException: Cannot refresh Entity. Record does not exist.
   at Devart.Data.Linq.Provider.DataProvider.GetAutoSyncValues(MetaType type, IDbCommand dbCommand, IList`1 autoSyncFields, IList`1 autoSyncParameters, IList`1 keyFields, IList`1 keyParameters)
   at Devart.Data.Linq.o.a(a A_0, MetaType A_1, h A_2, ModifiedMemberInfo[] A_3, Boolean A_4)
   at Devart.Data.Linq.l.a(i A_0, z A_1, Object A_2, Boolean A_3)
   at Devart.Data.Linq.u.a(l A_0, z A_1, Boolean A_2)
   at Devart.Data.Linq.u.a(DataContext A_0, ConflictMode A_1)
   at Devart.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
The linq we're running:

Code: Select all

				DB.LogUsers.InsertOnSubmit(new LogUser {
				        		Action = action,
				        		Ip = ip,
				        		Logtime = DateTime.Now,
				        		Message = message,
				        		Sessionid = sessionID,
				        		Success = success,
				        		UserName = userName
				        	});
				DB.SubmitChanges();
Here's the DBML portion:

Code: Select all

  
    
      
      
      
      
      
      
      
      
    
  
The ID is auto generated via trigger, same way it was in old versions.

This is the first call in the app that inserts anything, we're just record a login timestamp. Any clue as to what's wrong here, some error in our model that doesn't play well with the newer versions? I'm trying to debug the other issue I just posted with Union/Concat...swapping to old versions to make our application work is eating a bit of time here, would appreciate any help. As always, we can zip and send the model if needed. Thanks!
by Nahmis
Wed 24 Feb 2010 22:25
Forum: dotConnect for Oracle
Topic: Nested .Union() & .Concat() - NotSupportedException
Replies: 8
Views: 3337

Nested .Union() & .Concat() - NotSupportedException

We're having an issue that results in the following stack:

Code: Select all

   Specified method is not supported.
   at Devart.Data.Linq.Provider.Query.ao.a(SqlNode A_0, f A_1, SqlExpression A_2, Boolean A_3)
   at Devart.Data.Linq.Provider.Query.bf.b.a(w A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.a(d A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.a(j A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.e(w A_0)
   at Devart.Data.Linq.Provider.Query.bf.b.a(w A_0)
   at Devart.Data.Linq.Provider.Query.SqlVisitor.a(f A_0)
   at Devart.Data.Linq.Provider.Query.bf.a(SqlNode A_0, SqlFactory A_1, Boolean& A_2)
   at Devart.Data.Linq.Provider.DataProvider.a(e A_0, Type A_1, SqlNode A_2, IList`1 A_3)
   at Devart.Data.Linq.Provider.DataProvider.a(Expression A_0)
   at Devart.Data.Linq.Provider.DataProvider.i(Expression A_0)
   at Devart.Data.Linq.DataQuery`1.i()
This is as small as I could get the example still showing the error (Normal LinqPad .Dump() method):

Code: Select all

var DB = new DataContext(ConnectionString);
							
var a = from d in DB.Documents
	    join spd in DB.SitePacketDocuments on d equals spd.Document
	    where spd.Id == 1
	    select new {SiteId = 5, DocId = d.Id};
var b = from d in DB.Documents
	    select new {SiteId = 5, DocId = d.Id};

var u = a.Concat(b);
DB.GetCommand(u).CommandText.Dump(); //Ok here

var sitedocs = (from d in DB.Documents
				join did in u on d.Id equals did.DocId
				select new { did.SiteId, DocumentId = d.Id });
DB.GetCommand(sitedocs).CommandText.Dump(); //Not so ok
As far as I can tell, placing a where clause on any joined table in the union causes the Specified method is not supported error, if you change the top query to:

Code: Select all

var a = from d in DB.Documents
	    join spd in DB.SitePacketDocuments on d equals spd.Document
	    where d.Id == 1
	    select new {SiteId = 5, DocId = d.Id};
It works fine, but of course we're joining because we need the where clause elsewhere. I'd be happy to place this in a small test project if you have trouble reproducing, but this has become a very urgent issue for us (unexpected client deliverable), we would appreciate a reply asap. Thanks for the help guys, your support is superb.

Almost forgot, this is on the latest beta 5.55.97 (this behavior has existed for a long time, but we've been able to bypass around it until now).
by Nahmis
Tue 19 Jan 2010 12:55
Forum: dotConnect for Oracle
Topic: Feature Request - Better Source Control Integration
Replies: 4
Views: 1721

I just upgraded to 5.35.79 to test a bug before submitting it to you guys and I have to say: thanks for the installer improvements.

The upgrade process takes less than 1/3 of the user time it did before by not having to go hunt for the uninstall yourself. Thanks!
by Nahmis
Tue 19 Jan 2010 04:14
Forum: dotConnect for Oracle
Topic: Enum Support
Replies: 1
Views: 1388

Enum Support

Is there currently a way to use enums in LINQ-to-Oracle? Something like this exists in the Microsoft LINQ-to-SQL provider, any way to get equivalent behavior for the dotConnect oracle provider?

We have a RecordStatus column on every table, the RecordStatus is really an enum. It would be nice/more appropriate to be able to treat it this way instead of convertering to/from a int or long everywhere. Here's an example of what it would map to:

Code: Select all

 public enum RecordStatus
  {
   Active = 0,
   Inactive = 1,
   Deleted = 2
  }
by Nahmis
Tue 19 Jan 2010 03:44
Forum: Entity Developer
Topic: Stackoverflow Exception
Replies: 1
Views: 2252

Stackoverflow Exception

We're getting a stackoveflow exception (rigged up the debugger, no more detail than this available) upon opening the model. It seems to be some association combination that works fine, generates fine, but after saving and attempting to re-open the model, Entity Developer 2.50.51 crashes instantly.

Can we zip/send you the model so that you can either tell us where our error is, or fix whatever's causing this loop in Entity Developer? It's really preventing us from making fast progress, we're having to roll back the model every so often when whatever combination causing the crash appears and prevents us from editing again. Any help on this would be very appreciated.

Thanks!
by Nahmis
Fri 11 Dec 2009 16:53
Forum: dotConnect for Oracle
Topic: Feature Request - Better Source Control Integration
Replies: 4
Views: 1721

Feature Request - Better Source Control Integration

I know the title is broad, but we have some very specific problems relating to EntityDeveloper that make it a little difficult to work with inside a team using source control, hopefully you guys have some work-arounds, or can improve these things in a future release.

Generator/Absolute Settings
  • The template we use is in a static place beside the model, but there's no way to set a relative reference to this file, meaning each developer has to manually create their copy of the template (more on that below), any way this can be relative?

    The generation directory is also an absolute reference, relative would be useful here as well, otherwise each developer that changes the model has to set it to their local path of the project, generate, commit, and the next person if it's anyone else, has to change it again.

    The connection string to the database for the model would ideally not be stored in the model, but in a separate file which we could exclude from source control...different developers have different setups, and the database/connection strings may not be identical.
Template Creation
  • We all have the model in source control (and I could be an idiot if I am missing this please, please show me), currently there is no way to reference an existing template, you have to create and copy/paste in, and then save over the same template that's source controlled...even though I'm not changing it.

    This is more than a minor annoyance because of another problem...templates are lost each time we upgrade dotConnect. Can the templates either be stored on the model (as a relative path!) or somewhere on my system? Every upgrade of the software results in these steps:
    1) Uninstall dotConnect (manually, the new installer ideally would at least initiate this...)
    2) Install new dotConnect
    3) Open the model, go to add template
    4) Outside entity developer, go find the template, open it, copy everything
    5) Re-create the same template as before uninstall (the model is still asking for it by name!), paste the contents in
    6) Now I'm able to generate
In a source controlled environment everything else is relative, and anything that may be user-specific is usually stored in a separate file, source control being optional. I think with some simple changes/options to how these things work, it can make working with EntityDeveloper a lot less painful, the same for upgrading. The installer performing an install on the previous version would be great....I don't have to update just my machine, it's my machine, a secondary development box, a build server, a test server, a validation server and production...this currently is very costly in terms of time. I would point you to Resharper's install or anything from JGSoftware as a point of reference of how pain-free it can be to upgrade.

These suggestions aren't to sound negative, just our current bottlenecks when working with your product, we love the product and are impressed with the speed you guys have resolved our bugs. Keep up the great work...if you make improvements that would ease the problems I've listed above, it will make it even easier to use, at least in our case but hopefully to many other users.