identity

Best practices in logging the station that did something

I've seen too many incidents of someone having a password they shouldn't have. Thus I want to log the station from where the command came as well as who was logged in at the time. What is the best way to log the machine identity? I was thinking the MAC address except there can be multiple such addresses on a machine. IP won't work be...

JPA / Hibernate / MS SQL Server not returning generated id value

I am using Hibernate entity manager 3.5.1-Final with MS SQL Server 2005 and trying to persist multiple new entities. My entity is annotationally configured thus: @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; After calling entityManager.persist(newEntity) I do not see the generatedId set, it remains as 0. ...

Programmatically creating a client proxy for a WIF-secured WCF Service

Folks, Here's what I've done so far: 1) Created an ASP.NET MVC relying party application and secured it with ADFS v2.0. This works. 2) Created a WCF Service using the Claims-Aware service template for an ASP.NET website. I've turned ASP.NET compatibility for the service ON because the service wouldn't activate otherwise. I've moved th...

Problem adding entities in Entity Framework 4

Hi I have an entity that has a primary key that is set to identity and the type is bigint (long in C#). When I add a new object to ObjectContext and try to save changes to the database, I get the following error: A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: 'Id'." I don't really unde...

mysql/sql server: SELECT @@identity

is there a difference in the way this functions between the two databases mysql and sql server: SELECT @@identity ...

When to use the Endpoint Identity node when configuring a WCF client app?

My question stems from an earlier client proxy that svcutil generated for me based on a server configuration. I use a server side certificate credential using a Sql Memebership provider to authenticate the user. For the bindings I simply used <behavior name="MembershipBehaviour"> <serviceMetadata httpsGetEnabled="true" /> ...

Database Surrogate Key Name: Product.ProductId vs Product.Id vs Product.Product_Id

Say you have a table named Product and it has an auto-number/identity column. Do you name it simply Id or do you name it ProductId or Product_Id? Please explain why. ...

how to insert to a identity column using sequences in DB2

Hi, how to insert to a identity column using sequences in DB2? Thanks in advacne ...

asp.net web application fails to recognize user identity

We have a web application and it uses System.Web.UI.Page.User.Identity to determine who the current user is. We are experiencing an intermittent problem, where a user is not recognized (their identity is blank or empty). Anonymous authentication is disabled so I don't see how they can fully access the web application without it recognizi...

How to impersonate a non-existent user

We have a 3rd party webservice used to authorise users. Primarily it takes the calling user, checks their identity, and returns a cookie for subsequent requests. I would like to unit test it, making sure it throws the appropriate exception. Ideally something like this: var dummyIdentity = WindowsIdentity.GetAnonymous(); using (dummyId...

ODBC API to test of a parameter (by number) in an insert is an identity column

I work on a third party language product which does dynamic binding via ODBC and a customer is wanting to be able to insert bound variables without a field list, i.e. INSERT INTO table VALUES (values), not INSERT INTO table (columns) VALUES (values). The problem is that in the former case for SQLServer bind variables, the AUTO_INCREMENT...

OAuth 2.0 Open Source implementation in Java

We will shortly build a prototype which will play the role of an OAuth client to interact with sites such as Facebook. A requirement is that we use OAuth 2.0 (knowing it is still in draft status). Do you know of any Open Source Java implementations of an OAuth 2.0 client library? Our goal is to use it in our prototype, contributing to t...

T-Sql @@Identity

Does someone know how can I return the @@Identity when using T-Sql? Something like this: set @Sql = "insert into table....values()..." exec @sql return @@Identity ...

Trying to write file to UNC from ASP.NET MVC

I have some code running in an asp.mvc app inside IIS 7. The code is supposed to save a file to a UNC share. This function is called from some controller code, with the filePathname = "\MYSRV\sites\docs\10080003\egg.txt' public void EnsureDocument(string filePathName ,string content,WindowsIdentity identity ) { System.Security.Princi...

Checking the identity of a new table for database unit tests

I have a suite of database unit tests that were created. In order to replicate all of the tests on any machine I deploy out to there are scripts to drop the database and recreate it. The test will work for all of the unit tests except for the first test. The reason the first test fails is that I am executing the "dbcc checkident" comma...

Does Java guarantee that Object.getClass() == Object.getClass()?

I really do mean identity-equality here. For example, will the following always print true. System.out.println("foo".getClass() == "fum".getClass()); Thanks in advance, ~Mack ...

SQL query for identity key on table

I have the table in SQL Server 2008. It has empId, which is the int of type. It is not identity for now. I want to write the query (so that I can maintain the record of changes in DB) to make this columns as identity column. This table have no data currently. ...

How can I rewrite this MS SQL Script as a MySQL Script?

I'm trying to work my way through a Java Tutorial. The author wrote the tutorial to work with MS SQL. I'd like to follow the tutorial using MySQL. I'm not completely sure how to translate the MS SQL script which uses "IDENTITY", "CONSTRAINT", and "CLUSTERED" as you'll see below: CREATE TABLE [event_person] ( [event_id] [int] NOT NU...

Can one control the identity of objects in Java, and if so, how?

Hi all, This is a trivial programming question. I am not an expert in Java. Say I use objects of custom classes Company and Employee, in a manner similar to what many RDBMS examples do: class Employee { Company company; } class Company { String name; } I need to guarantee that different Company objects have unique names - i....

PHP - ORM Lazy Load/Identity Map implementation question

Hi all, I have a bare bones ORM implementation, consisting of data mappers which load and persist entities. Each mapper internally manages an identity map for all entities read from the database, so that the same entity is only loaded into memory once. I am currently implementing lazy loading for related entities using a proxy class th...