c# - RavenDB 2.5 LoadByUniqueConstraint failing to Load -
here's reproduction
using build 2.5.2910
so store member in database normal way:
await session.storeasync(member)
i can sign in, member, when
await session.loadbyuniqueconstraintasync<member>(m => m.email, email)
i batch update of email addresses (the batch contains 1 email address)
for (var batch = 0; (records = allrecords.skip(batch * batchsize).take(batchsize).tolist()).any(); batch++) { using(var querysession = this.documentstore.opensession()) { var existingmembers = session.query<member, member_byemail> ().where(m => m.email.in(records.select(r => r.oldemailaddress))).todictionary(m => m.email, m => m); using(var bulkinsertoperation = this.documentstore.bulkinsert(this.systemconfiguration.databasename, new bulkinsertoptions { checkforupdates = true })) { foreach(var member in records) { var existingmemberkey = member.oldemailaddress; var existingmemberrecord = existingmembers[existingmemberkey]; existingmemberrecord.email = member.emailaddress; } } } }
when try , log in again new email address, line:
await session.loadbyuniqueconstraintasync<member>(m => m.email, email)
returns null....
i've checked new email being used same 1 in database. database shows new one. i've used database interface , queried index new email , works.
i've set database use wait non stale results , also:
store.conventions.defaultqueryingconsistency = consistencyoptions.alwayswaitfornonstaleresultsasoflastwrite;
none of these options have worked.
i'm wondering if there special have bulk insert operation in order .net client read indexes new email.
i've drilled session variable @ runtime , found there known missing ids field value:
"uniqueconstraints/members/email/ym1hcmxletfabmv3b3jiaxquy28udws="
Comments
Post a Comment