Search found 5 matches

by darnocian
Wed 26 Aug 2020 13:44
Forum: Universal Data Access Components
Topic: Connection pooling setup
Replies: 44
Views: 20928

Re: Connection pooling setup

I just have a related issue... trying to figure out how connection + connection pool + transactions would work in a multithreaded environment.... rather than just on a gui with relatively static components...

I would have assumed a component decomposition:
- connnection pool
- connection connected to connection pool (active = true it is not in 'free' pool and in use, active=false it is back in 'free' pool)
- transaction is associated with a connection. with pooling enabled on a connection, I don't know what 'pooling' actually means... is there some thread tracking taking place via tls variables?

anyone done multitheeading with transactions?
by darnocian
Sun 23 Aug 2020 11:43
Forum: EntityDAC
Topic: Enabling pooling with entitydac
Replies: 3
Views: 19467

Enabling pooling with entitydac

I'm using EntityDAC with UniDAC and postgres.

On UniDAC, it is clear as to how to use pooling - just enable the property...

However, on EntityDac using the TEntityConnection, I'm not sure.

Any advice on how to do this without recreating connections every time?

Maybe by overloading one of the factory methods for creating a connection, which could use a pooled TUniConnection?
by darnocian
Sun 23 Aug 2020 11:36
Forum: EntityDAC
Topic: Exception: Parameter 'returnId' not found
Replies: 5
Views: 25663

Re: Exception: Parameter 'returnId' not found

I posted something on another issue where I had the same issue. Unfortunately, in my case the EntityDeveloper didn't do enough for me and the 'returnId' was a bit misleading... I used attributes from the code generator. As I was using a postgresql sequence (the postgres equivalent of auto_increment), I changed the annotation to the following which worked for me: [Column('id', []), Generator(gtTable)]
by darnocian
Sun 23 Aug 2020 11:33
Forum: EntityDAC
Topic: EntityDAC linq with Many-To-Many queries
Replies: 1
Views: 17785

EntityDAC linq with Many-To-Many queries

I couldn't find any documentation really showing how to do queries on many-to-many relations...

When I tried something, I got:
Message: TQueryConverter.TranslateMemberLink: TMetaAssociationManyToMany is not implemented yet (EntityDAC.Linq.Converter.pas, line 268)

Not sure if it is just me not knowing how to do something, it LINQ support doesn't support ManyToMany yet... it would be ideal if it could though...

result := Context.GetEntity<TMyEntity>(
Linq.From(MyEntity).Where(
(MyEntity.MyManyToMany.All(MyOtherEntity.Id = AOtherId)) and
(MyEntity.Id = AID)).Select());

Not sure if this is how it would be done.
by darnocian
Sun 23 Aug 2020 11:22
Forum: EntityDAC
Topic: parameter'returnId' not found
Replies: 8
Views: 26685

Re: parameter'returnId' not found

Latest update didn't work for me as was assuming an underlying bug somewhere. However, I figured out what the problem was.
I had a postgresql db with a table with an id of type serial (an auto_increment type on postgres). With EntityDeveloper, it refelected the column correctly. However, it kept on returning the 'returnId'... seeing this is actually a bit confusing at first because 'returnId' was nowhere to be found... tracing the code, it was actually obvious that my field 'Id' which was the primary key which would be populated during the insert was the problem, and 'returnId' was just something the entitydac layer was manufacturing. I updated the annotation to [Column('id', []), Generator(gtTable)] ... and issue was sorted.

So ideally the error message could be more specific to reference the actual field name 'id' rather than the internal variation... and possibly a hint to validate that a Generator might need to be used...